0% found this document useful (0 votes)
2 views7 pages

Chapter 3 MCQ 2 Ajp

The document presents the online exam results for a student named Kapadia Kush Amit, detailing their performance in an event handling exam. The exam consists of multiple-choice questions related to Java event handling concepts, with the student scoring a total of 17 out of 20 marks. Each question includes the correct answer, the student's answer, and the corresponding score for that question.

Uploaded by

nebuladreamerx
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)
2 views7 pages

Chapter 3 MCQ 2 Ajp

The document presents the online exam results for a student named Kapadia Kush Amit, detailing their performance in an event handling exam. The exam consists of multiple-choice questions related to Java event handling concepts, with the student scoring a total of 17 out of 20 marks. Each question includes the correct answer, the student's answer, and the corresponding score for that question.

Uploaded by

nebuladreamerx
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/ 7

10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Online Exam Result

Exam : AJP - Chapter 3 - Event Handling Class : CO5I Div : A

Student Name : KAPADIA KUSH AMIT Roll No. : 20203A0055 Enrollment No.
: 2005680051

Sr. Your Correct


Question Marks
No Answer Answer
To process scroll bar events, you need to implement
________________ interface.

a) b)

1 AdjustmentListener MouseListener a c 0

c) d)

AdjustmentListener KeyListener

Which of the following method does not belongs to


WindowListerner interface?

2 b b 1
a) windowActivated b) windowReactivated
d)
c) windowDeiconified
windowClosed()

Which of the following method is invoked when a window is


changed from a normal to a minimized state?

b)
3 a a 1
a) windowIconfified()
windowClosed()

c) d)

windowDeactivated() windowOpened()

Which methods are used to close the window?

a) setVisible(false) b) windowClosing()
4 c) d) b d 0

stop() both a and b

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 1/7
10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Sr. Your Correct


Question Marks
No Answer Answer

______ is an object that describes a state change in the source.

a) event
5 b) Source a a 1

c) d)

None of the Above All of the above

Complete the following signature:

void
addTreeExpansionListener(___________________________ tel)
6 b b 1
a) TreeExpansionlistener b) TreeExpansionListener
d)
c) TreeListener
treeListener

Event class is defined in which of these libraries?

7 a) java.io b) java.lang d d 1
d)
c) java.net
java.util

______________ method returns a value that indicates


which modifier key were pressed when the action event is
generated.

8 a) getModifiers() b) setModifiers() c a 0

c) d)

getActionCommand() None of These

Which class header would be used to create an applet that accepts


a click on a button?

a) public class MyApplet b) public class MyApplet


9 extends Japplet implements extends JApplet implements b b 1
Listener ActionListener
d) public class MyApplet
c) public class MyAppletextends
extends Japplet implements
Japplet implements ActionEvent
Event

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 2/7
10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Sr. Your Correct


Question Marks
No Answer Answer

Which of these methods can be used to change location of an


event?

a) changePoint() b)
10 b b 1
translatePoint()

c)
d) translateCordinates()
changeCordinates()

Which of these class is super class of all the events?


a) EventClass b) EventObject
11 d) b b 1
c) ActionEvent
ItemEvent

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 3/7
10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Sr. Your Correct


Question Marks
No Answer Answer
Identify correct methods in the place of blank space:

public class Test extends Applet implements


_______________
{
String msg="";
public void init()
{
addKeyListener(this);
}
public void keyPressed(_____________ k)
{
showStatus("KeyPressed");
}
public void keyReleased(KeyEvent k)
{
showStatus("KeyRealesed");
}
12 public void keyTyped(KeyEvent k) a a 1
{
msg = msg+k.getKeyChar();
repaint();
}
public void paint(Graphics g)
{
g.drawString(msg, 20, 40);
}
}

a) b)

KeyListener, KeyEvent MouseListener,MouseEvent

c) d)

ActionListener, ActionEvent WindowListener, WindowEvent

Which of these methods will respond when you click any button
by mouse?

13 a) mouseClicked() b) mouseEntered() d d 1
c)
d)
mousePressed()
All of the above

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 4/7
10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Sr. Your Correct


Question Marks
No Answer Answer

Which of the following are correct event handling methods?

a) MousePressed(MouseEvent e) b) MousePressed(MouseClick e)
14 a a 1
{} {}
d)
c) functionKey(KeyPress k){}
Added(ContainerEvent e){}

The ___________method returns a reference to the component


that was added to or removed from the container.

a) b)
15 c c 1
getParent() getComponent()

c) d)

getChild() geoReferenced()

A general form, event registration method-

a) b)

void addTypeListener public void addTypeListener


16 b b 1
(TypeListener el) (TypeListener el)

c) d)

public TypeListener public void


(TypeListener el) addTypeListener (el)

The following specifies the advantages of ___________

It is lightweight.

It supports pluggable look and feel.

It follows MVC (Model View Controller) architecture.


17 a a 1

a) Swing b) AWT
c) d)

Both a and b None of the above

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 5/7
10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Sr. Your Correct


Question Marks
No Answer Answer
Which of these events will be generated if we close an applet’s
window?

18 a) ActionEvent b) ComponentEvent d d 1
d)
c) AdjustmentEvent
WindowEvent

19 Consider the following output. Find the missing statement in the c c 1


program.

import java.awt.*;

import java.awt.event.*;

import java.applet.*;

import javax.swing.*;

/* */

public class SimpleKey1 extends JApplet implements


KeyListener

String msg = "";

int X = 10, Y = 20;

public void init()

addKeyListener(this);

requestFocus();

public void keyPressed(KeyEvent ke)

showStatus("Key Down");

public void keyReleased(KeyEvent ke)

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 6/7
10/12/22, 8:45 PM Vidyalankar Polytechnic | VP

Sr. Your Correct


Question Marks
No Answer Answer
showStatus("Key Up");

public void keyTyped(KeyEvent ke)

msg += ke.getKeyChar();

repaint(); }

public void paint(Graphics g)

g.drawString(msg, X, Y);

a) Missing Semicolon b) Missing {


c) d)

Missing } Missing()

If a class MyWindowAdapter extends WindowAdapter and


implements the windowClosing() method. How to register this
class ?
a) this.addWindowListener(new b) addWindowListener(new
20 MyWindowAdapter()); MyWindowAdapter()); a a 1
c)
d) addWindowListener(new
this.addListener(new
MyAdapter());
MyWindowAdapter());

Total Marks : 20

Obtained : 17

Student Signature _____________________________

https://mycollege.vpt.edu.in/student/end_practice_exam_new.php 7/7

You might also like