Professional Documents
Culture Documents
Sanjivani K. B. P. Polytechnic: Department of Computer Technology
Sanjivani K. B. P. Polytechnic: Department of Computer Technology
SANJIVANI K. B. P.
POLYTECHNIC
Department of Computer Technology
KOPARGAON – 423601, DIST: AHMEDNAGAR
2023-2024
4. Which is a component in AWT that can contain another component like buttons, textfields, labels etc?
a) Window b) Container c) Panel d) Frame
6.Runnable is
a)Class b) Method c) Variable d) Interface
7. Executable applet is
a). applet file b) .java html c) .java file d) .class file
8. Which method executes only once?
a) start() b) stop() c) init() d) destroy()
9. Applet can be embedded in
a) HTML document b) word document c) gif file d) rtf file
10. Which is the container that doesn’t conatin the title bar and MenuBars.It can have other components like button,
textfield.
a) Window b) Frame c) Panel d) Conatiner
11. Which is a passive AWT control that do not generate any event?
a) Button b) RadioButton c) Choice d) Label
16. Which of the following method is used to set a TextComponent to read‐only mode?
a) Editable( ) b) nonEditable( ) c) setEchoChar( ) d) setEditable( )
17. Which of the following generates action events when an item is double‐clicked.
a) List b) Checkbox c) MenuItem d) TextField
18. Which of the following does have its default layout as BorderLayout.
a) Frame b) Dialog c) JApplet d) All of Above
25. The title of the frame can be set in AWT using which of the following method?
a) setHeading b) setTitle c) CreateTitle d) Settitle
26.Which of these classes can be added to any container class, using the add method defined in container
class?
a) Button b) CheckboxMenuItem c) Menu d)MenuBar
27.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()
30. The title of the frame can be set in AWT using the method.
a) setHeading b) setTitle c) createTitle d) settitle
31. Which are passive controls that do not support any interaction with the user?
a) Choice b) List
c) Labels c) Settitle
32. Which abstract class is super class of all the menu related class?
a)MenuComponent b) MenuBar c) MenuItem d) CheckboxMenuItem
33. By which method we can set or change the text in a Label in AWT?
a) setText() b) getText() c) addText() d) all of these
38.Color class can create object of it using which of the following color values?
a) RGB b) RYB c) CMY d) HSB
40.A class displays a dialog window from which a user can select a file.
a) Dialog b) FileDialog c) File d) None of these
46. 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
47. Which object can be constructed to show any number of choices in the visible window?
a) Choice b) Menu c) List d) Checkbox
48. By which method we can set or change the text in a label in AWT?
a) setText() b) getText() c) addText() d) all of these
50. The setBackground () method is a part of which of the following class java.awt package?
a) Component b) Applet c) Object d) Graphics
51. Which of the following is true about applet?
a) Applets do not have a main() method.
b)Applets must run under applet viewer or web browser
c)The user I/O is not performed using java’s stream I/O class
d) All of these.
52. Which class is used to represent a single line of text with password character facility
a) TextField b)TextArea c) Label d) Checkbox
57. In the given constructor what third parameter indicates: Scrollbar s= new Scrollbar(10,20,0,100)?
a) size of thumb b) minimum value c) maximum value d) Initial value
60. What does the following line of code do? TextField tf = new TextField(20);
a) create text object that can hold 20 rows of text
b) create the object text and initializes it with value 20
c) creates text box that can hold 20 columns of text
d) This is invalid code
61. Which method is used to count the number of items in the list?
a) getItem() b) getSelectedItem() c) getItemCount() d) getCount()
63. Which method is use to set password character for the textfield?
a) setPasswordCharacter()
b) setEchoChar()
c) setPassChar()
d) setEchoCharacter()