You are on page 1of 2

- All questions are compulsory. (Q.1 to Q.7: 1 Mark each, Q.8 to Q.

16: 2 Marks each)

Q. 1) Which one the following describes AWT?


a) Applet Windowing b) Abstract c) Absolute d) None of the Above
Toolkit Windowing Windowing
Toolkit Toolkit
Q. 2) What do you remember about the Frame?
a) Panel, Radio b) MenuBar, c) Title Bar, d) Rersizing corners,
Button, Button Borders Border, Resizing borders, checkbox
corners
Which container doesn’t contain title bar and menu bar but can have other components like
Q. 3) button, textfield etc.?
a) Window b) Frame c) Panel d) Container
Where are the following four methods commonly used?
Q. 4) 1) public void add(Component C) 2) public void setSize(int width, int height)
3) public void setLayout(LayoutManager m) 4) public void setVisible(boolean)
a) Graphics class b) Component class c) Both a & b d) None of the Above
Suppose that you want to have an object eh handle the TextEvent of a TextArea object t.
How should you add eh as the event handler for t?
Q. 5)
a) t.addTextListener(eh); b) eh.addTextListener(t);
c) addTextListener(eh.t); d) addTextListener(t, eh);
a) A b) B c) C d) d
Q. 6) Which of these methods can be used to determine the type of event?
a) getID() b) getSource() c) getEvent() d) getEventObject()
Q. 7) Which of these events will be generated if we close an applet's window?
a) ActionEvent ComponentEvent AdjustmentEvent WindowEvent
Q. 8) Which one of the following is a valid declaration of an applet?
a) public class b) public Applet c) public class d) abstract class
MyApplet extends MyApplet{ MyApplet MyApplet extends
java.applet.Applet{ extends applet java.applet.Applet{
implements
Runnable{
What is the length of the application boxmade by this program?
import java.awt.*;
import java.applet.*;
Q. 9)
public class myapplet extends Applet
{ Graphics g;
g.drawString("A Simple Applet", 20, 20);}
a) 20 b) Default Value c) Compilation d) Runtime Error
Error
What is the message will be displayed in the applet by this program?
Q. import java.awt.*;
10) import java.applet.*;
public class myapplet extends applet{
public void paint(Graphics g){
g.drawString("A Simple Applet", 20, 20);
}}
a) A Simple Applet b) A Simple Applet c) Compilation d) Runtime Error
20 20 Error
Q. How would you pass values to parameters of an Applet?
11)
a) Xml b) Applet c) Html d) java
Q. What attributes param tag accepts?
12)
a) Name b) Value c) Name & value d) None of these

Which of the following are true?


a) A component may handle its own events by adding itself as an event listener.
Q. b) A component may handle its own events by overriding its event-dispatching method.
13) c) A component may not handle its own events.
d) A component may handle its own events only if it implements the handleEvent( )
method.
a) a, b b) b, c c) c, d d) a, d
Q. What is an event in delegation event model used by java programming language?
14)
a) An event is an b) An event is an c) An event is an d) An event is a class
object that object that object that used for defining
descirbes a state descirbes a state descirbes any object, to create
change in source. change in change by the events.
processing. user and system.
Q. Which of these events will be notified if scrollbar is manipulated?
15)
a) ActionEvent b) ComponentEvent c) AdjustmentEvent d) WindowEvent
What methods to be implemented for preparing following output?

Q.
16)

a) addFocus() b) FocusGained() c) focusGained() d) None of these


removeFocus() FocusRemoved() focusLost()

You might also like