Advance Java Test Paper
Advance Java Test Paper
a. Window
b. Container
c. Panel
d. Frame
a. 7
b. 6
c. 5
d. 8
a. Java.awt
b. Java.graphics
c. Java.awt.graphics
d. None of these
5. Which is the container that doesn’t contain title bar and menu bars. It can
have other components like button, text field etc?
a. Window
b. Frame
c. Panel
d. Container
6. Which object can be constructed to show any number of choices in the visible
window?
a. Choice
b. Menu
c. List
d. Checkbox
a. setText()
b. getText()
c. addText()
d. all of these
a. Server side
b. Client side
9. Which method of the applet class displays the result of applet code on screen?
a. Run() method
b. Paint() method
c. drawstring() method
d. main() method
a. HTML document
b. Word document
c. Gif file
d. Rtf file
a. .applet file
b. .java html
c. .java file
d. .class file
13. Which of the following is used to interpret and execute Java Applet Classes
Hosted by HTML?
a. Applet Viewer
b. Applet Screen
c. Applet watcher
d. Applet show
a. Graphical
b. User interactive
c. Both a & b
d. None of the above
a. Display()
b. Paint()
c. Show()
d. All of these
17. Which object can be constructed to show any number of choices in the
visible window?
a. Labels
b. Choice
c. List
d. Checkbox
18. Which of the following class is derived from the container class?
a. Component
b. Panel
c. Menu component
d. List
a. Draw()
b. Update()
c. Show()
d. Paint()
20. Which method executes only once ?
a. Start()
b. Stop()
c. Init()
d. Destroy()
22. Which of these classes can be added to any container class, using the add
method defined in the container class?
a. Button
b. checkboxMenuItem
c. menu
d. menubar
23. which of the following methods can be used to change the size of a
java.awt.component object?
a. Dimension()
b. Setsize()
c. Area()
d. Size()
a. True
b. False
26. The title of the frame can be set in AWT using the method.
a. setHeading
b. setTitle
c. Create Title
d. setTitle
27. Which are passive controls that do not support any interaction with the user?
a. Choice
b. List
c. Labels
d. Checkbox
a. 1
b. 2
c. 3
d. 4
29. By which method we can set or change the text in an Label In AWT?
a. setText()
b. getText()
c. addText()
d. all of these
31. Which layout manager places components in one of the five regions : north,
south , east , west and center?
a. Absolute layout
b. Grid layout
c. Border layout
d. Flow layout
a. Border layout
b. Card layout
c. Grid layout
d. Flow layout
a. Flow layout
b. Border layout
c. Grid layout
d. All of these
a. Card layout
b. Gridbag layout
c. Frame
d. Border layout
a. Checkbox
b. Drop-down
c. Choice
d. None of these
36. Pluggable look and feel and lightweight components are the features
supported by ________
a. Swing
b. AWT
c. Core java
d. None of these
a. Client server
b. Model view controller
c. layered
d. None of these
38. Swing is not a part of JFC that is used to create GUI application.
a. True
b. False
39. The java foundation classes ( JFC ) is a set of GUI components which
simplify the development of desktop applications.
a. True
b. False
a. A
b. S
c. G
d. J
41. _____ is one of the features of object oriented programming that allows the
creation of hierarchical classifications.
a. Polymorphism
b. Class
c. Inheritance
d. Object
a. AbstractButton
b. JToggleButton
c. JComponent
d. None of these
a. JComboBox
b. JTextArea
c. JSlider
d. All of the above
44. In swing class hierarchy the class present at the root is ___
a. Component
b. Window
c. Container
d. Object
a. Glsass
b. Content
c. Container
d. All of the above
a. Setimg
b. setIcon
c. serLabelIcon
d. none of this
a. JList
b. JComboBox
c. JLabel
d. All of the above
a. JButton
b. JCheckBox
c. JRadioButton
d. Both b & c
49. The swing component classes that are used in encapusulates a mutually
exclusive set of buttons?
a. Abstractbutton
b. ButtonGroup
c. JButton
d. ImageIcon
50. Which method of the component class is used to set the position and size of
a component?
a. setPosition
b. setBounds
c. setSize
d. none of these
1. canvas is a component
2. scrollpane is a container
a. Window
b. Frame
c. Dialog
d. All of the above
a. Button
b. Textfield
c. Label
d. List
a. Flowlayout
b. Gridlayout
c. Border layout
d. Gridbag layout
a. True
b. False
59. In swing _____ gives the visual representation of the component.
a. Model
b. View
c. Controller
d. None of these
a. Model
b. View
c. Controller
d. None of these
61. Which of these packages contains all the event handling interfaces?
a. Java.lang
b. Java.awt
c. Java.awt.event
d. Java.event
a. Same class
b. Other class
c. Anonymous class
d. All of these
a. EventObject
b. Eventclass
c. ActionEvent
d. ItemEvent
64. 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
65. Which of these interfaces handles the event when a component is added to
the container?
a. componentListener
b. ContainerListener
c. FocusListener
d. InputListener
a. Componentlistener
b. Containerlistener
c. Actionlistener
d. Inputlistener
a) Componentlistener
b) Containerlistener
c) Actionlistener
d) Inputlistener
a. Actionevent
b. Componentevent
c. adjustmentEvent
d. WindowEvent
a. ActionEvent
b. KeyEvent
c. WindowEvent
d. AdjustmentEvent
70. Which of these methods can be used to obtain the command name for
invoking ActionEvent object ?
a. getCommand()
b. getActionCommand()
c. getActionEvent()
d. getActionEventCommand()