wood burning stoves 2.0*
The moose likes Mock Exam Errata and the fly likes Marcus Green Exam #3, Question 59 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Marcus Green Exam #3, Question 59" Watch "Marcus Green Exam #3, Question 59" New topic
Author

Marcus Green Exam #3, Question 59

Jon Dalberg
Greenhorn

Joined: Feb 19, 2001
Posts: 4
Here is the question:
Which of the following statements are true?
1) The x,y coordinates of an instance of MouseEvent can be obtained using the getX() and getY() methods
2) The x,y coordinates of an instance of MouseEvent can be obtained using the X and Y integer fields
3) The time of a MouseEvent can be extracted using the getTime() method
4) The time of a MouseEvent can be extracted using the when parameter of the MouseEvent constructor
According to the exam, the answers are 1 and 4. However, I disagree. Maybe it's just semantics but if a MouseEvent is passed to a MouseListener or a MouseMotionListener, there is no way to 'extract' the time of the MouseEvent from the constructor.
I think the only correct answer is 1. Anyone else?
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Jon,
That one stumped me also. I think, to give Marcus the benefit of the doubt, the logic goes like this:
MouseEvent extends InputEvent
InputEvent has a method: getWhen() that can be used to return the time when the event occurred. The value that is returned from the method is set inside the MouseEvent constructor which accepts a when parameter ...
Confused yet?
Manfred.
Jon Dalberg
Greenhorn

Joined: Feb 19, 2001
Posts: 4
Originally posted by Manfred Leonhardt:
Hi Jon,
That one stumped me also. I think, to give Marcus the benefit of the doubt, the logic goes like this:
MouseEvent extends InputEvent
InputEvent has a method: getWhen() that can be used to return the time when the event occurred. The value that is returned from the method is set inside the MouseEvent constructor which accepts a when parameter ...
Confused yet?
Manfred.

I agree that you can pass the time when a MouseEvent is 'created', but you can't 'extract' the time from a MouseEvent's ctor; you must use the getWhen() method. Perhaps the wording is ambiguous.
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
My logic was based on the following description of the constructor
(just cut and pasted from http://java.sun.com/products/jdk/1.2/docs/api/java/awt/event/MouseEvent.html)
MouseEvent(Component�source,
int�id,
long�when,
int�modifiers,
int�x,
int�y,
int�clickCount, boolean�popupTrigger)

I picked on the when parameter as being available. Does that make sense?. I'm keen to ensure my questions are not ambiguous, let me know what you think.
Marcus

SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Jon Dalberg
Greenhorn

Joined: Feb 19, 2001
Posts: 4
Originally posted by Marcus Green:
My logic was based on the following description of the constructor
(just cut and pasted from http://java.sun.com/products/jdk/1.2/docs/api/java/awt/event/MouseEvent.html)
MouseEvent(Component�source,
int�id,
long�when,
int�modifiers,
int�x,
int�y,
int�clickCount, boolean�popupTrigger)

I picked on the when parameter as being available. Does that make sense?. I'm keen to ensure my questions are not ambiguous, let me know what you think.
Marcus

If you had said
4) The time of a MouseEvent can be extracted FROM the when parameter of the MouseEvent constructor
then I would say the 4 is also a valid choice. I think it's a little ambiguous with the word 'using' because it implies that one can use the when parameter from the ctor.
Russell Tao
Greenhorn

Joined: Dec 13, 2004
Posts: 12
Originally posted by Jon Dalberg:


If you had said

4) The time of a MouseEvent can be extracted FROM the when parameter of the MouseEvent constructor

then I would say the 4 is also a valid choice. I think it's a little ambiguous with the word 'using' because it implies that one can use the when parameter from the ctor.

It is not a little ambiguous. It's totally ambiguous.
Just wonder why they make scjp questions so impratical, nonesense, rubbish, useless....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Marcus Green Exam #3, Question 59
 
Similar Threads
Marcus Mock #59
Marcus exam 3 # 59
Marcus green exam 3
Mock exam
Marcus Green Exam 3 Q 59