Applet MCQs

Applet MCQs

Answer these 20 Applet MCQs and assess your grip on the subject of Applet. Scroll below and get started!

1: Which of the following components allow multiple selections?

A.   Non-exclusive Checkboxes

B.   Choice

C.   Text Boxes

D.   Radio buttons

2: All Applets must import java.applet and java.awt.

A.   True

B.   False

3: Which method is called only once during the run time of your applet?

A.   Destroy()

B.   Init()

C.   Stop()

D.   Paint()

4: To determine the width and height of an application, which of the following method is used?

A.   SetWidthHeight()

B.   GetSize()

C.   SetHeightWidth()

D.   GetWidthHeight()

5: Java.applet defines how many interfaces?

A.   1

B.   3

C.   4

D.   6

6: Which is the correct order for lifecycle of an applet?

A.   None

B.   Applet is painted,started,stopped,initilaized,destroyed

C.   Applet is initialized,started,painted,stopped,destroyed

D.   Applet is intialized,started,painted,destroyed,stopped

7: The java.applet.Applet class 4 life cycle methods and java.awt.Component class provides how many life cycle methods for an applet?

A.   1

B.   2

C.   5

D.   3

8: What is the immediate super class of Applet class?

A.   Panel

B.   Component

C.   Window

D.   Object

9: In the following statements which is a drawback for Applet?

A.   It works at client side so less response time

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

C.   Plugin is required at client browser to execute applet

D.   Secured

10: Which life cycle method of an applet java.awt.Component class provides?

A.   Public void paint(Graphics g)

B.   Public void init()

C.   Public void stop()

D.   Public void destroy()

11: What tags are mandatory when creating HTML to display an applet?

A.   Name, height, width

B.   Codebase, height, width

C.   Code, name

D.   Code, height, width

12: Which Component method is used to access a component's immediate Container?

A.   GetImmediate()

B.   GetParent()

C.   GetVisible()

D.   GetContainer()

13: Which Called when an applet begins execution, It is the first method called for any applet?

A.   Void init()

B.   None

C.   Void destroy()

D.   Boolean isActive()

14: What is the color of the line, which is drawn by the following code snippet?grph.setColor(; grph.drawLine(0, 0, 100,100);

A.   Red

B.   Cyan

C.   Blue

D.   Green

15: Which of the following methods set the frame surface color to pink?

A.   None

B.   SetColor(PINK);

C.   SetBackground(;

D.   Background(pink);

16: Which layout is used as their default layout by Window, Frame and Dialog classes?

A.   GridLayout

B.   FlowLayout

C.   BorderLayout

D.   CardLayout

17: Which one of the following is a valid declaration of an applet?

A.   Public class MyApplet extends applet implements Runnable {

B.   Public Applet MyApplet {

C.   Public class MyApplet extends java.applet.Applet {

D.   None

18: Applet works at client side so less response time?

A.   True

B.   False

19: Java Plug-in software is not responsible to manage the lifecycle of an Applet?

A.   True

B.   False

20: The APPLET tag is used to start an applet from both an HTML document and from an applet viewer?

A.   True

B.   False