Awt Answer1
Awt Answer1
SANJIVANI K. B. P. POLYTECHNIC
Department of Computer Technology
KOPARGAON – 423601, DIST: AHMEDNAGAR
2023-2024
6.Runnable is
a) Class b) Method c) Variable d) Interface
7. Which collection class associates values with keys, and orders the keys according to their naturalorder
a) java.util.HashSet b) java.util.LinkedList c) java.util.TreeMap d) java.util.SortedSet
11. What does the following line of code do? TextField tf = new TextField(10);
(a) will set 10 to TextField as its initial text b) Will set the character capacity to 10
(c) Both A & B d) None of These
12. Frame is a standard window, which is of Window class from AWT hierarchy?
a) Derived class / Subclass b) Base class / Super class c) Root class d) Family class
18. Which of the following does not have its default layout as BorderLayout.
a) Frame b) Dialog c) JApplet d) All of Above
26. What is use of second parameter given in Label constructor : Label(String, int)
(a) Specifies height of label in terms of pixels
(b) specifies width of label in terms of pixels
27.Which of these classes can be added to any container class, using the add method defined incontainer
class?
a) Button b) CheckboxMenuItem c) Menu d)MenuBar
28.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()
29.Which of the following methods can be used to remove a java.awt.Component object from thedisplay?
a) disappear() b) delete() c) remove() d) hide()
30.These two ways are used to create a Frame
1.By creating the object of Frame class(association)2.By extending Frame class
(inheritance)
a)True b) False
31. The tittle of the frame can be set in AWT using the method.
a) setHeading b) setTitle c) createTitle d) settitle
32. Which are passive controls that do not support any interaction with the user?
a) Choice b) List
c) Labels c) Settitle
33.How Many ways can be align the label in a container?a) 1 b) 2
c) 3 d) 4
34. 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
39.Color class can create object of it using which of the following color values?
a) RGB b) RYB c) CMY d) HSB
44. The concept of Menu Bar can be implemented by using three java classes-
a) Menu b) MenuBar c) MenuItem d) All of these
45. Which method is used to append the text at the end of TextArea?
a) append() b) add() c) appendAt() d) addAt()
46. The immediate super class of TextArea is
a) TextField b) TextBox c) TextComponent d) Component
47. Which is the container that doesn’t contain title bar and menu bars. It can have other componentslike button, text
field etc?
a) Window b) Frame c) Panel d) Container
48. Which object can be constructed to show any number of choices in the visible window?
a) Choice b) Menu c) List d) Checkbox
49. 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
59. Which object can be constructed to show any number of choices in the visible window?
a) Label b) Choice c) List d) Checkbox
60. Which of the following class is derived from the container class?
a) Component b) Panel c) MenuComponent d) List