Java Programming - Java Applets Questions and Answers

Related Topics:

Java Programming : Java Applets

This is Java Programming Questions and Answers Section on "Java Applets". These Questions are very useful for various interviews.
1. Which method is called first by an applet?
[A] start()
[B] run()
[C] init()
[D] paint()

Answer: C. init()

2. To display text on the applet........method is used.
[A] showString()
[B] drawString()
[C] println()
[D] printString()

Answer: B. drawString()

3. To run an applet..........command is used.
[A] run
[B] java
[C] appletviewer
[D] applet

Answer: C. appletviewer

4. AppletViewer tool is available in which of the folder of JDK :
[A] bin
[B] lib
[C] source
[D] class

Answer: A. bin

5. The Applet class is in ...........package
[A] java.applet
[B] java.awt
[C] java.io
[D] java.util

Answer: A. java.applet

6. which method can be used to draw a circle in the applet?
[A] drawCircle()
[B] drawOval()
[C] drawArc()
[D] both b and c

Answer: D. both b and c

7. To display text in the applet status bar.........method is used.
[A] showStatus()
[B] showStatusBar()
[C] drawStatus()
[D] drawStatusBar()

Answer: A. showStatus()

8. which of the following is an optional attribute of applet tag?
[A] Code
[B] Name
[C] Width
[D] Height

Answer: B. Name

9. Which method can be used to draw a rectangle in the a Applet?
[A] drawRect()
[B] drawPolygon()
[C] drawLine()
[D] all of these

Answer: D. all of these

10. which package contains color class?
[A] java.applet
[B] java.awt
[C] java.graphics
[D] java.lang

Answer: B. java.awt


Comments: (Your feedback is valuable to us)
;