Ajp Question MCQ
Ajp Question MCQ
a. True b. False
4) Which object can be constructed to show any number of choices in the visible window?
a. Labels b. Choice
c. List d. Checkbox
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
7) AWT has more powerful components like tables, lists, scroll panes, color chooser, tabbed
pane etc.
a. True b. False
A) Applet is intialized,started,painted,destroyed,stopped
B) Applet is painted,started,stopped,initilaized,destroyed
C) Applet is initialized,started,painted,stopped,destroyed
D) None of the above
A) By html file
B) By AppletViewer tool(for testing purpose)
C) Both A & B
D) None of the above
12) The Java Foundation Classes (JFC) is a set of GUI components which simplify the
development of desktop applications?
A) True B) False
13) If we want to create TextArea of 100 character in width and 30 character in height, which is
correct constructor for achieve our scenario?
a) new TextArea(100,30)
b) new TextArea(30,100)
c) new TextArea(100,30,100,30)
d) All of these
a) Component->Container->Panel
b) Component->Container->Window->Frame->Panel
c) Component->Container->Window->Panel
d) Container->Component->Panel
a. BorderLayout b. FlowLayouc.
C.FrameDefaultLayout d. GridLayout
16) Select the missing statement in
the program for following output
import java.awt.*;
public class MenuDemo extends Frame
{
public static void main(String args[])
{
MenuDemo m = new MenuDemo();
m.setVisible(true);
MenuBar mbr = new MenuBar();
m.setMenuBar(mbr);
Menu filemenu = new Menu("File");
Menu editmenu = new Menu("Edit");
Menu viewmenu = new Menu("View");
mbr.add(filemenu);
mbr.add(editmenu);
MenuItem new1 = new MenuItem("New");
MenuItem open1 = new MenuItem("Open");
filemenu.add(new1);
filemenu.add(open1); } }
A.mbr.add(view); B.mbr.add(menu);
C.mbr.add(vieweditmenu); D.mbr.add(viewmenu);
c.Applet,Button d.GridLayout,label,Button
18..Which component will be needed to get following output?
a.Label,Tabbedpane,Checkbox, b.Tabbedpane,List,Applet,
c.Panel,TabbedPane,List d.Applet,TabbedPane,Panel
26..To get the following output complete the code give n below:
a. setBorderLayout() c. setLayout()
b. setLayoutManager() d.setAppletLayout()
a) AWT c.Swing
b) MVC d.All of the above
a) AppletDefaultLayout
b) BorderLayout
c) FlowLayout
d) GridLayout
1. JApplet
2. JFrame
3. JLabel
4. Canvas
32 If we want to create TextArea of 100 character in width and 30 character in height, which is
correct constructor for achieve our scenario?
1. new TextArea(100,30)
2. new TextArea(30,100)
3. new TextArea(100,30,100,30)
4. All of these
1. JTable
2. Table
3. JTableSwing
4. JTableRoot
34.I want to make my TextField is read only state, which TextComponent method is used?
1. Editable
2. setEditable()
3. setNonEditable()
4. setEchoChar()
1. Left to Right
2. Right to Left
3. North to East
4. East to West
1. Component->Container->Panel
2. Component->Container->Window->Frame->Panel
3. Component->Container->Window->Panel
4. Container->Component->Panel
b. BorderLayout
c. FlowLayout
d. FrameDefaultLayout
e. GridLayout
1. JApplet
2. JPanel
3. Panel
4. Container
1. EventObject
2. Event
3. AWTEvent
4. SuperAWTEvent
1. java.swing
2. java.awt.event
3. java.util
4. java.awt
1. setVisible(false)
2. stop()
3. destroy()
4. dispose()
1. RadioButton
2. CheckBox
3. CheckBoxGroup
4. ComboBoxGroup
1. getCurrentValue()
2. getCurrentValueScrollbar()
3. getValue()
4. getSelect()
1. Glass
2. Component
3. Content
4. Container
47.Which is Cosmic (base) superclass of Java? or All the classes in java is derived from ______.
1. Object
2. Class
3. EventObject
4. AWTEvent
a) JComponent c. JMenuItem
b) JButton d. None of these
49.What is the purpose of JTable ?
a.rollOverIcon(ImageIcon i)
b.setIcon(ImageIcon i)
c.displayIcon(ImageIcon i)
d.removeIcon(ImageIcon i)
A. TextField, Label
B. List, Button
C. Choice, Button
D. Button, TextField
add(l);}
a.
c.
c.
d.
Debug the following program2M
*/
67
};
contentPane.add(jsp, BorderLayout.CENTER);
a) FlowLayout
b) GridLayout
c) BorderLayout
d) TwoDLayout
Which method can be used to get degree of adjustment made by the user?
a) getAdjustment()
b) getValue()
c) getAdjustmentValue()
d) None of these
a) ComponentEvent
b) ActionEvent
c) InputEvent
d) All of the above
1. ItemAdapter
2. ButtonAdapter
3. ActionAdapter
4. MouseAdapter
1. addMouseListener()
2. registerMouseLIstener()
3. addMouseMotionListener()
4. registerMouseMotionListener()
How to get name of control which generate ActionEvent?
1. getName()
2. getActionCommand()
3. getActionNameControl()
4. obtainAction()
1. Event Source
2. Action Object
3. Event
4. Notified Object
1. EventObject
2. Event
3. AWTEvent
4. SuperJavaEvent
1. MouseEventObject
2. TextEvent
3. InputEvent
4. EventObject
1. ActionEvent, TextEvent
2. ItemEvent, KeyEvent
3. ActionEvent, ItemEvent
4. FocusEvent, ActionEvent
1. ScollbarEvent
2. AdjustmentEvent
3. ActionEvent
4. MouseEvent
1. TextListener
2. EventListener
3. EventObject
4. ActionListenerBase
1. 7
2. 8
3. 9
4. 10
1. 80
2. 81
3. 82
4. 90
Consider the provided link, understand it and choose correct option: Param1 and Param2 are
the names of parameter
1. ServletMapping.xml
2. Servlet.xml
3. ServletConfig.xml
4. web.xml
1. We can not send data using get method because post method is used to send data.
2. With the help of body part
3. With the help of payload information
4. With the help of URL
MIME stands for ______________(Not providing options: Multipurpose Internet Mail
Extension)
ResultSetMetaData interface object created by which method of which interface?
1. executeQuery()
2. executeUpdate()
3. getStatment()
4. Both 1 & 2
1. Type 1
2. Type 2
3. Type 3
4. Type 4
1. URLCOnnection Object
2. URL Object
3. PreparedStatment object
4. Connection object
For Select SQL query which method is used in Java?
1. executeQuery()
2. executeUpdate()
3. executeSelect()
4. executeBatch()