NEW
Font size
WorksheetsApplet Java
Total questions: 10
Worksheet time: 14mins
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. Server
b. Webserver
c. Container
d. Application Server
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. Banner using Applet
b. Basic Applet
c. Display clock
d. None of the above
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. public void play()
b. public void loop()
c. public void stop()
d. None of the above
4) Which are the common security restrictions in applets?
a. Applets can't load libraries or define native methods
b. An applet can't read every system property
c. Applets can play sounds
d. Both A & B
From the following statements which is a drawback for Applet?
a. It works at client side so less response time
b. Secured
c. It can be executed by browsers running under many platforms, including Linux, Windows, and Mac Os etc.
d. Plugin is required at client browser to execute applet
The APPLET tag is used to start an applet from both an HTML document and from an applet viewer.
a. True
b. False
What invokes immediately after the start() method and also any time the applet needs to repaint itself in the browser?
a. stop()
b. init()
c. paint()
d. destroy()
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 Simple Applet
b) A Simple Applet 20 20
c) Compilation Error
d) Runtime Error
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20); } }
a) 20
b) 50
c) 100
d) System dependent
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
Graphic g;
g.drawString("A Simple Applet", 20, 20);
}
a) 20
b) Default value
c) Compilation Error
d) Runtime Error
