JAVA 21

COEP
Lets Crack Online Exam

IT Interview Exam Questions: JAVA 21 (IT Campus Placement)

Subject: JAVA 21

Part 21: List for questions and answers of JAVA

 

Q1. Which method is called first by an applet?

a) start()

b) run()

c) init()

d) paint()

 

Q2. To display text on the applet……..method is used

a) showString()

b) drawString()

c) println()

d) printString()

 

Q3. To run an applet……….command is used

a) run

b) java

c) appletviewer

d) applet

 

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

a) bin

b) lib

c) source

d) class

 

Q5. The Applet class is in ………..package

a) java.applet

b) java.awt

c) java.io

d) java.util

 

Q6. which method can be used to draw a circle in the applet?

a) drawCircle()

b) drawOval()

c) drawArc()

d) both b and c 

 

Q7. To display text in the applet status bar………method is used

a) showStatus()

b) showStatusBar()

c) drawStatus()

d) drawStatusBar()

 

Q8. which of the following is an optional attribute of applet tag?

a) Code

b) Name

c) Width

d) Height

 

Q9. Which method can be used to draw a rectangle in the a Applet?

a) drawRect()

b) drawPolygon()

c) drawLine()

d) all of these

 

Q10. which package contains color class?

a) java.applet

b) java.awt

c) java.graphics

d) java.lang

 

Q11. Which class is used to get dimensions of an applet?

a) Dimension

b) metrics

c) Applet

d) fontMetrics

 

Q12. 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)

 

Q13. 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) 

 

Q14. 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)

 

Q15. 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

 

Q16. Which of these package is used for graphical user interface?

a) java.applet

b) java.awt

c) java.awt.image

d) java.io

 

Q17. Which of these package is used for analyzing code during run-time?

a) java.applet

b) java.awt

c) java.io

d) java.lang.reflect

 

Q18. Which of these package is used for handling security related issues in a program?

a) java.security

b) java.lang.security

c) java.awt.image

d) java.io.security

 

Q19. Which of these class allows us to get real time data about private and protected member of a class?

a) java.io

b) GetInformation

c) ReflectPermission

d) MembersPermission 

 

Q20. Which of these package is used for invoking a method remotely?

a) java.rmi

b) java.awt

c) java.util

d) java.applet 

 

Part 21: List for questions and answers of JAVA

 

Q1. Answer: c

 

Q2. Answer: b

 

Q3. Answer: c

 

Q4. Answer: a

 

Q5. Answer: a

 

Q6. Answer: d

 

Q7. Answer: a

 

Q8. Answer: b

 

Q9. Answer: d

 

Q10. Answer: b

 

Q11. Answer: a

 

Q12. Answer: b

 

Q13. Answer: c

 

Q14. Answer: b

 

Q15. Answer: d

 

Q16. Answer: b

 

Q17. Answer: d

 

Q18. Answer: a

 

Q19. Answer: c

 

Q20. Answer: a