Class Test Question Bank: Subject: Advance Java Subject Code: 22517
Class Test Question Bank: Subject: Advance Java Subject Code: 22517
a. Graphics class
b. Component class
c. Both A & B
d. None of the above
2) Implement the Listener interface and overrides its methods is required to perform
in event handling.
a. True
b. False
4) In Graphics class which method is used to draws a rectangle with the specified
width and height?
a. public void drawRect(int x, int y, int width, int height)
b. public abstract void fillRect(int x, int y, int width, int height)
c. public abstract void drawLine(int x1, int y1, int x2, int y2)
d. public abstract void drawOval(int x, int y, int width, int height)
6) Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
a. Window
b. Container
c. Panel
d. Frame
9) Which package provides many event classes and Listener interfaces for event
handling?
a. java.awt
b. java.awt.Graphics
c. java.awt.event
d. None of the above
16) Which statement creates a Text Area with 10 rows and 20 columns?
a. TextArea text = new TextArea(10,20);
b. TextArea text = new TextArea(20,10);
c. TextArea text = new TextArea(200);
d. None of Above
17) How many line input takes from user in Text Field in AWT.
a. 3
b. 2
c. 1
d. None of Above
21) Which layout is used to arrage components in a line left to right on after another?
a. FlowLayout
b. GridLayout
c. BorderLayout
d. CardLayout
22) _________ component provides to show various dialog such as error, user
specific message, confirmation etc.
a. JDialogBox
b. JFileChooser
c. Jtable
d. JOptionPane
23) Which of following interface define a method itemStateChanged()?
a. ActionListener
b. ItemListener
c. MouseListener
d. ComponentListener
27) Which of the methods are used to register a mouse motion listener?
a. addMouse()
b. addMouseListener()
c. addMouseMotionListner()
d. None of Above