wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Applet Java

Total questions: 10

Worksheet time: 14mins

Name
Class
Date
1.

In Servlet Terminology what provides runtime environment for JavaEE (j2ee) applications. It performs many operations that are given below

1. Life Cycle Management

2. Multithreaded support

3. Object Pooling

4. Security etc.

a)

a. Server

b)

b. Webserver

c)

c. Container

d)

d. Application Server

2.

The following example shows the creation of a

import java.applet.*;

import java.awt.*;


public class Main extends Applet{

public void paint(Graphics g){

g.drawString("Welcome in Java Applet.",40,20);

}

}

a)

a. Banner using Applet

b)

b. Basic Applet

c)

c. Display clock

d)

d. None of the above

3.

An applet can play an audio file represented by the AudioClip interface in the java, applet package Causes the audio clip to replay continually in which method?

a)

a. public void play()

b)

b. public void loop()

c)

c. public void stop()

d)

d. None of the above

4.

4) Which are the common security restrictions in applets?

a)

a. Applets can't load libraries or define native methods

b)

b. An applet can't read every system property

c)

c. Applets can play sounds

d)

d. Both A & B

5.

From the following statements which is a drawback for Applet?

a)

a. It works at client side so less response time

b)

b. Secured

c)

c. It can be executed by browsers running under many platforms, including Linux, Windows, and Mac Os etc.

d)

d. Plugin is required at client browser to execute applet

6.

The APPLET tag is used to start an applet from both an HTML document and from an applet viewer.

a)

a. True

b)

b. False

7.

What invokes immediately after the start() method and also any time the applet needs to repaint itself in the browser?

a)

a. stop()

b)

b. init()

c)

c. paint()

d)

d. destroy()

8.

import java.awt.*;

import java.applet.*;

public class myapplet extends Applet {

public void paint(Graphics g) {

g.drawString("A Simple Applet", 20, 20);

}

}

a)

a) A Simple Applet

b)

b) A Simple Applet 20 20

c)

c) Compilation Error

d)

d) Runtime Error

9.

import java.awt.*;

import java.applet.*;

public class myapplet extends Applet {

public void paint(Graphics g) {

g.drawString("A Simple Applet", 20, 20); } }

a)

a) 20

b)

b) 50

c)

c) 100

d)

d) System dependent

10.

import java.awt.*;

import java.applet.*;

public class myapplet extends Applet {

Graphic g;

g.drawString("A Simple Applet", 20, 20);

}

a)

a) 20

b)

b) Default value

c)

c) Compilation Error

d)

d) Runtime Error