Unit Test: I(Question Bank)
Name of Subject: Advanced Java Programming Subject Code: 22517
Course: CO Semester: V
1.Combobox is a combination of
a)textfield and drop down list b)checkboxes c)textareas d)None
2.To add the items in the Jcombobox we used
a)add() b)addItem() c)addCombobox() d)addcombo()
3. Which class is super class for Container class.
a) Window b) Panel c) Component d) Frame
4. Frame can have
a) title bar b) Menubar c)Corners d) All
5. Adding controls in a window we used
a) add() b) submit() c)append() d) insert()
6.Checkboxes are the object of type
a) Radio button b) Checkbox c) Label d)TextField
7.check box state can be changed by
a)void setSelected(boolean state) b)void select(state) c)void add() d)None
8. To set a perticular Layout we used
a) getLayout() b) setLayout() c) insertLayout() d) Layout()
9.GridLayout used layout in
a) 3D Grid b) 1D Grid c) 2D Grid d) None.
10._____uses applet for running GUI application
a)applet b)awt c)util d)io
11.Gird layout consist of
a)rows b)columns c)both a and b d)none
12.Java applets are used to create ______applications
a)graphical b)user interactive c)both a and b d)none
13.Which of the following is used to interpret and execute Java Applet Classes hosted by HTML
a)AppletViewer b) Appletscreen c) Appletwatcher d)Appletshowe
14.When applet is dead, it automatically invokes the ______method when we quit the browser.
a)paint() b) stop() c) destroy() d) final()
15.Which of the following applet method displays the result of the applet code on the screen?
a) paint() b)void() c)init() d)start()
16.Menubar could be applied to ___________
a)Applet b) Frame c) Both a & b d) None
17. Menubar contains
a) Menus b) String c) MenuItems d) both a and c
18.JButton class provides the functionality of
a)button b)push button c)button with label d)button with icon
19.To set the title of the Button ____method is used
a)setText(String str) b)setTitle(String str) c)setString(String str) d)setLabel(String str)
20.Choose correct syntax of constant for color class
a)Color b)Color.GREEN c)Color.red d)All of the above
21.In Graphics class which method is used to set the graphics current color to the specified color?
a) public abstract void setFont(Font fontobj) b) public abstract void setColor(Color c)
c) public abstract void grawString(String str, int x,I nt y) d) None of above
22.To apply the image we used the class
a)Image b)ImageIcon c)IconImage d)ImageIconic
23.Which of the following methods can be used to remove java.awt.Component object from
display?
a) hide() b) disappear() c) remove() d) delete()
24.Which layout is default layout for applet.
a)Flow Layout b)Border Layout c)Grid Layout d)GridBag Layout
25.Which layout is default layout for Frame
a) Grid Layout b)Border Layout c) Flow Layout d)GridBag Layout
26.On which side applet is always executed
a)Server b)Client c)online d)offline
27.To initialize the objects for applet we used____
a)init() b)start() c)destroy() d)block()
28. Dialog boxes can be of types
a) model b) modeless c) both a and b d) dialogfile
29.Choose the following type in which we can work on other parts of the program.
a) modeless b) model c) both a and b d) dialog
30.What are the subclasses of the Container class?
a) Windows, Panel, ScrollPane b) ScrollPane, Vector, String
c) Thread, Vector, String d) Applet, InetAddress, Vector
31.Which object is needed to group Checkboxes to make them exclusive?
a) CheckboxGroup b) Checkbox c) RadioButton d) TextField
32.Jar is the _______
a)Java Archived b)Java Architect c)Java Array d)Java array render
33.The supported constructor of JComboBox are
a)JComboBox(Has h) b) JComboBox(Vector v) c) JComboBox(JTree jt)
d) None of above
34.setEchochar method is used for
a)text display in textfield b)password c)textarea d)checkboxes
35.By default page down and page up increments are
a)1 2)5 c)10 d)4
36.By default unit increments and unit decrements are
a)5 2)10 c)10 d)1
37.Which class is used to make a radio button in applet
a)RadioButton b)Checkbox c)CheckboxGroup d)CheckBox
38Choose a class in which we create an object of table class
a)Table b)JTable c)TableRow d)Object
39.Progress bar is important component which indicates
a)progress of some task b)progress of bar c)only progress
d)progress of components
40.JProgressBar extends the class
a)JProgress b)JComp c)JPanel d)JComponent
41To add components to container window _________ method is used.
a)add() b)addComponentName() c) Both a & b d) None of above
42. ___________ class represents node of a Tree
a)MutableTreeNode b) DefaultMutableTreeNode c) TreeNode d) None of above
43.The ActionListener interface is used for handling action events, For example, it's used by a
(a) JButton (b) JCheckbox (c) All of these (d) JMenuItem
44.Which class is used for this Processing MethodprocessActionEvent( )?
(a) Button,List,MenuItem (b) Button,Checkbox,Choice
(c) Scrollbar,Component,Button (d) None of the above
45 Which package provides many event classes andListener interfaces for event handling?
(a) java.awt (b) java.awt.Graphics
(c) java.awt.event (d) None of the above
46 The ActionListener interface is not used for handling action events?
(a) True (b) False
47. Which Listener handles all List related Events?
(a) ItemListener (b) InputEvent
(c) SelectEvent (d) ListEvent
48 Which of these interfaces define a method actionPerformed()
(a) ComponentListener (b) ContainerListener
(c) ActionListener (d) InputListener
49 Button Control implements following listenerinterface.
(a) ItemListener (b) ActionListener
(c) FlowListener (d) Adapter
50 The _________ is an object that is notified when an event occurs.
(a) Listener (b) Sources (c) Event (d) None of the above
51 What is the use of String getActionCommand( ) method of ActionEvent class?
(a) to obtain the label (caption) of Button
(b) to obtain the reference of Button
(c) to obtain object of Button
(d) to obtain the label (caption) and object of Button
52 The signature for the registration method for a ActionEvent should be _______.
(a) public void addActionListener(ActionEvent L)
(b) public void setAction(ActionListener L)
(c) public void setActionListener(ActionListener L)
(d) public void addActionListener(ActionListenerL)
53.From following list which is not Swing class?
(a) JLabel (b) JButton (c) JImageIcon (d) JCheckBox
54. Which component provides support for two‐state buttons?
(a) Button, Checkbox (b) JCheckBox,JRadioButton
(c) Button, MenuItem (d) JCheckBox, TextField
55. What is the use of : Container getContentPane( )
(a) Returns Container for a JDialog (b) Returns a ContentPane for Menu
(c) Returns a ContentPane for Applet (d) None of the above
56. Which package is used for import the swing components?
(a) java.swing (b) java.awt (c) javax.swing (d) All of the above
57 The String parameter to JButton constructor______________.
(a) tell which region to put the JButton in.
(b) tells the color of the JButton.
(c) tells what text will appear on JButton.
(d) tells what should happen when JButton is pressed.
58
58In swing, Buttons are subclasses of which class?
(a) AbstractButton (b) JButton
(c) Button (d) JRadioButton
59 JTree class belongs to which package?
(a) java.awt (b) java.applet
(c) java.swing (d) javaxswing
60 Which of the following is not constructor of JTree?
(a) JTree(TreeNode tn) (b) JTree(Vector v)
(c) JTree(int x) (d) none of the above