Monday, 2 April 2012

MCQ- Applet


MCQ- Applet

1. AppletViewer tool is available in which of the folder of JDK :

A. bin
B. lib
C. source
D. class

2 . The Applet class is in ………..package
A.java.applet
B.java.awt
C.java.io
D.java.util

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

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


5. Which method is called first by an applet?
A.start()

B.run()
C.init()
D.paint()
6. which of the following is an optional attribute of applet tag?
A.Code
B.Name
C.Width
D.Height

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

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

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

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

11. Which class is used to get dimensions of an applet?
A.Dimension
B.metrics
C.Applet
D.fontMetrics

12. The constructor for Font class is…………….
A.Font(String name)
B.Font(string name,int style,int size)
C.Font(String name,int size)
D.Font(String name,int style)

13. The syntax of paint()method is…………….
A. public void paint()
B. public void paint(String s)
C. public void paint(Graphics g)
D. public void paint(Graphics g,String s)

14. The syntax of drawstring() method is……………..
A. void drawstring(String s)
B. void drawstring(String s,int x,int y)
C. void drawstring(int x,int y,string s)
D. void drawstring(String x,int x)

15. The(0,0) coordinates of applet window is located at……
A. at the center of the applet
B. at the center of the right edge of the applet
C. at the center of the left edge of the applet
D. at the upper-left corner of the applet




Answers :
1
- A
2
- A
3
- C
4
- B
5
- C
6
- B
7
- A
8
- D
9
- D
10
- B
11
- A
12
- B
13
- C
14
- B
15
- D












Posted By :Ruchita Pandya

2 comments:

  1. copy from http://www.eduzip.com/java-programming/java-applets/page3.html

    please upload your own questions

    ReplyDelete
  2. Thanks for sharing this information and technology solutions

    ReplyDelete