• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marcus green exam 3

 
Jeff Gaer
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 59)
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 getWhen method
Objective 4.6)
1) The x,y coordinates of an instance of MouseEvent can be obtained using the getX() and getY() methods
4) 4) The time of a MouseEvent can be extracted using the getWhen method

If you chose option 4, referring to the mythical getTime method you have made a reasonable guess based on the normal conventions of Java. However the conventions do not always hold true. If you chose option 3 perhaps you are not as aware of the conventions as you should be.
http://www.jchq.net/tutorial/04_06Tut.htm
Is the correct answer only 1) the discussion of 4 is rather confused and I can not find any getWhen or getTime methods.
 
Nain Hwu
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is the correct answer only 1) the discussion of 4 is rather confused and I can not find any getWhen or getTime methods

MouseEvent inherits getWhen() from its superclass InputEvent.
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/j2se/1.4/docs/api/java/awt/event/MouseEvent.html
------------------

http://www.jchq.net Mock Exams, FAQ,
Tutorial, Links, Book reviews
Java 2 Exam Prep, 2nd Edition by Bill Brogden and Marcus Green
=================================================
JCHQ, Almost as good as JavaRanch
=================================================
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic