AJP Question Bank Class Test 1 Jan 2020
AJP Question Bank Class Test 1 Jan 2020
AJP Question Bank Class Test 1 Jan 2020
HirabaiHaridasVidyanagari, Amrutdham,
Panchavati,Nashik-422003
Department of Computer Technology(Both Shift)
Class: TYCM-I & II Date: 23/01/2017
Question Bank
Subject: AJP (17625)
51. Which constructor creates a checkable menu item with initially checked?
1. CheckBoxMenuItem() b)CheckBoxMenuItem(String str) c)CheckBoxMenuItem(String str, true)
d)CheckBoxMenuItem(String str, false)
71. Which class encapsulates a blank window upon which we can draw?
a) Applet b)Canvas c)Window d)Frame
72. If we want to hide the Dialog box, we can use this method…
a) setVisible( ) b)show( ) c) setHidden( ) d)hide( )
79. Which method is used to append the text at the end of TextArea?
a) append( ) b) add( ) c) appendAt( ) d)addAt( )
96. How will you assign the string and icon both to the JButton?
a) It is not possible b) Use the setTextIcon( ) method c)Use the setIconText( ) method
d) Intialize them directly in the constructor
import java.awt.*;
import javax.swing.*;
a) b) c) d) Error
import java.awt.*;
import javax.swing.*;
import javax.swing.*;
a) 1 b) 2 c) 3 d) 4
108. Which of the following statements is for placing the frame's upper left corner to (200, 100)?
a) frame.setLocation(100, 100) b) frame.setLocation(100, 200)
c)frame.setLocation(200, 100) d) frame.setLocation(200, 200)
a) Label, TextField, Button b) Applet, Label c) Applet, Button d) Grid Layout, Label, Button
117. Which is the container that doesn't contain title bar and MenuBars but it can have other components
like button, textfield etc?
a) Panel b) Frame c) Window d) Applet
118. Which object can be constructed to show any number of choices in the visible window?
a) Lable b) Button c) Checkbox d) RadioButton
119. Which of these methods are used to know which key is pressed?
a) getActionEvent() b) getKey() c) getActionKey() d) getModifier()
120. What is a listener in context to event handling?
a) A listener is a variable that is notified when an event occurs.
b) A listener is an object that is notified when an event occurs.
c) A listener is a method that is notified when an event occurs. d) None of the mentioned
121. The Following steps are required to perform
1) Implement the Listener interface and overrides its methods
2) Register the component with the Listener
a) Exception Handling b) String Handling c) Event Handling d) None of the above
122. What does the following line of code do?
TextField t1=new TextField(10);
a) Creates a Text object that can hold 10 rows of text. b) Creates the object text & initializes it with
value 10. c) Creates text object that can hold 10 columns of text. d)The code is illegal.
123. class A1
{ public static void main(String ar[])
{ Frame f1=new Frame(); } }
a) Frame window is created b) Frame window created but not seen c) Compilation Error
d) Runtime Error
129. Which items we can’t directly add to JTree using its constructor?
a) Objects array b) Vector c)Hash table d)Arrays