posted 22 years ago
Hi Fraternity and Nitin,
The correct answer is (B). The reason is that the getID() of java.awt.AWTEvent returns an int corresponding to event that caused it. For example in case of events caused by mouse are
Mouse Events
a mouse button is pressed
a mouse button is released
a mouse button is clicked (pressed and released)
the mouse cursor enters a component
the mouse cursor exits a component
Mouse Motion Events
the mouse is moved
the mouse is dragged
The values returned by the mouse event are
elucidated in the java.awt.event.MouseEvent class
Kindly refer to the API for the explanation of the same
static int MouseEvent.MOUSE_CLICKED
static int MouseEvent.MOUSE_DRAGGED
static int MouseEvent.MOUSE_RELEASED
static int MouseEvent.MOUSE_PRESSED
static int MouseEvent.MOUSE_FIRST
static int MouseEvent.MOUSE_LAST
static int MouseEvent.MOUSE_ENTERED
static int MouseEvent.MOUSE_EXITED
Orginally posted by Fraternity
<quote>
In the class java.awt.AWTEvent,which is the parent class upon which
jdk1.1 awt events are based there is a method called getID(),which phr
ase most accerrately describes in significance of the reture value of
this method?
A.It is a reference to the object directly affected by the cause of th
e event.
B.It is an indication of the nature of the cause of the event.
C.It is an indication of the position of the mouse when it caused the
event.
D.In the case of a mouse click,it is an indication of the text under t
he mouse at the time of the event.
E.It tells the state of certain keys on the keybord at the time of the
event.
F.It is an indication of the time at which the event occurred.
In my view option A ic correct,Let me know if i am right or put the right answer out there
and state the reason behind the selection of your answer
</quote>
Kindly get back incase further clarification is sought on this.
Regards,
Ravindra Mohan
[This message has been edited by Ravindra Mohan (edited May 01, 2001).]