Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCJP Thread question from MG's mock exam

 
Georgy Bolyuba
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which of the following are methods of the Thread class?

1wait()
2yield()
3pause()
4start()

The Correct Answer is
2) yield()

yield is a static method of the Thread class
4) start()

start() is a method of the Thread class and causes the thread to begin execution (a direct quote from the JDK1.4 docs


What about wait() method
 
Sergei Iakhnin
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wait() is a method of the Object class.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The wait() method is inherited from the Object class just like the
notify() and the notifyAll() methods.
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API docs for Thread are at

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html

Where wait is listed as being inherited from Object. Could I have feedback as to if this question is ambigious/misleading?

I have been re-working all the JDK1.4 material for JDK1.5 so if it needs changing it should be changed for the 1.5 material.
 
Gail Schlentz
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe worded like "...methods defined in the Thread class..." ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic