0% found this document useful (0 votes)
21 views6 pages

AJP Question Bank

Yash

Uploaded by

Yash Sawant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

AJP Question Bank

Yash

Uploaded by

Yash Sawant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Q. 1. Give the abbreviation of AWT ?

(a) Applet Windowing Toolkit (b) Abstract Windowing Toolkit

(c) Absolute Windowing Toolkit (d) None of the above

Answer: b

Q. 2 Which is the container that contain title bar and can have MenuBars. It can have other
components like button, textfield etc.?

(a) Panel (b) Frame

(c) Window (d) Container

Answer: b

Q. 3 Which is a component in AWT that can contain another components like buttons, textfields,
labels etc.?

(a) Window (b) Container

(c) Panel (d) Frame

Answer:b

Q. 4 AWT is used for GUI programming in java?

(a) True (b) False

Answer:a

Q. 5 Which class provides many methods for graphics programming?

(a) java.awt (b) java.Graphics

(c) java.awt.Graphics (d) None of the above

Answer:c

Q. 6 These two ways are used to create a Frame By creating the object of Frame class (association)
By extending Frame class (inheritance)

(a) True (b) False

Answer:a

Q. 7 Which is the container that doesn't contain titlebar and MenuBars. It can have other
components like button, textfield etc?

(a) Window (b) Frame

(c) Panel (d) Container

Answer:c

Q. 8 How many types of controls does AWT supports these controls are subclasses of component?
(a) 7 (b) 6

(c) 5 (d) 8
Answer:a

Q. 9 Which are passive controls that do not support any interaction with the user?

(a) Choice (b) List

(c) Label (d) Checkbox

Answer:c

Q. 10 By which method You can set or change the text in a Label ?

(a) setText() (b) getText()

(c) Both A & B (d) None of the above

Answer:a

Q. 11 Which class is used to create a pop‐up list of items from which the user may choose?

(a) List (b) Choice

(c) Labels (d) Checkbox

Answer:b

Q. 12 Which object can be constructed to show any number of choices in the visible window?

(a) Labels (b) Choice

(c) List (d) Checkbox

Answer:c

Q. 13 Which is used to store data and partial results, as well as to perform dynamic linking, return
values for methods, and dispatch exceptions?

(a) Window (b) Panel

(c) Frame (d) Container

Answer:c

Q. 14 The following way is used to create a frame is by creating the object of Frame class?

(a) inheritance (b) association

(c) Both A & B (d) None of the above

Answer: c

Q. 15 AWT more powerful components like tables, lists, scroll panes, color chooser, tabbed pane
etc.?

(a) True (b) False

Answer: a

Q. 16 The following specifies the advantages of It is lightweight. It supports pluggable look and feel.
It follows MVC (Model View Controller) architecture.
(a) Swing (b) AWT

(c) Both A & B (d) None of the above

Answer: a

Q. 17 Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application?

(a) True (b) False

Answer:b

Q. 18 The Swing Component classes that are used in Encapsulates a mutually exclusive set of
buttons?

(a) AbstractButton (b) ButtonGroup

(c) JButton (d) ImageIcon

Answer: b

Q. 19 The Java Foundation Classes (JF(c) is a set of GUI components which simplify the development
of desktop applications?

(a) True (b) False

Answer: a

Q. 20 Which package is used for import the swing components?

(a) java.swing (b) java.awt

(c) javax.swing (d) All of the above

Answer: c

Q. 21 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.

Answer: c

Q. 22 MVC architecture is

(a) Modelling – Visual – Controller (b) Model – View – Controller

(c) Model – Viewable – Controller (d) Many – View – Controller

Answer: b

Q. 23 Alignment constants of JLabel are the part of

a) SwingConstants interface b) SwingConstants class

c) Swing class d) Graphics class

Answer: a

Q. 24 In swing, Buttons are subclasses of which class?


(a) AbstractButton (b) JButton

(c) Button (d) JRadioButton

Answer: a

Q. 25 JTree class belongs to which package?

(a) java.awt (b) java.applet

(c) java.swing (d) javax.swing

Answer: d

Q. 26 Which component is swing represents data in row and columns?

(a) JTextArea (b) JTable

(c) JPanel (d) JtabbedPane

Answer: b

Q. 27 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

Answer: c

Q. 28 class used to create node in tree.

(a) TreeNode (b) DefaultMutableNode

(c) DefaultMutableTreeNode (d) Node

Answer: c

Q. 29 JTabbedPane class is present in which package?

(a) java.awt (b) java.swing

(c) java.awt.swing (d) javax.swing

Answer: d

Q. 30 What is purpose of JTree?

(a) To show data in form of parent and child nodes. (b) To show data in list view.

(c) To show data in tabular form. (d) To show data in menu‐bar.

Answer: a

Q. 31. The Following steps are required to perform Implement the Listener interface and overrides
its methods Register the component with the Listener

(a) Exception Handling (b) String Handling


(c) Event Handling (d) None of the above

Answer: c

Q. 32 In which places can put the event handling code

(a) Same class (b) Other class

(c) Annonymous class (d) All mentioned above

Answer: d

Q. 33 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

Answer: c

Q. 34 To use the ActionListener interface it must be implemented by a class there are several ways
to do that find in the following?

(a) Creating a new class (b) using the class the graphical component

(c) an anonymous inner class (d) All mentioned above

Answer: d

Q. 35 The ActionListener interface is not used for handling action events?

(a) True (b) False

Answer: b

Q.3 6 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

Answer: c

Q.37 Which class is used for this Processing Method processActionEvent( )?

(a) Button,List,MenuItem (b) Button,Checkbox,Choice

(c) Scrollbar,Component,Button (d) None of the above

Answer: a

Q. 38 In Graphics class Which method is used to set the graphics current color to the specified
color?

(a) public abstract void setFont(Font font) (b) public abstract void setColor(Color c)

(c) public abstract void drawString(String str, int x, int y) (d) None of the above

Answer: b

Q. 39 Which of the following method is used to determine the type of adjustment event?
(a) getType( ) (b) getEventType( )

(c) getAdjustmentType( ) (d) getEventObjectType( )

Answer: c

Q. 40 TextField generates event.

(a) ActionEvent,ItemEvent (b) ActionEvent, TextEvent

(c) ScrollEvent,TextEvent (d) ActionEvent, ScrollEvent

Answer: b

You might also like