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

Problem with Devakas Final Exam Q on Static Thread methods

 
sandeep muley
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chose the available static methods from the following list(Choose two)
A. Thread.start();
B. Thread.setprioprity
C. Thread.sleep
D. Thread.getname
E. Thread.yield
F. Thread.run
G. Thread.CurrentThread
H. Thread.join

Answer EG

Why not C.................
 
Ivan Ivanic
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. Sleep is static, don't know why they did not marked it as correct
 
sandeep muley
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lets bring this to Devakas notice..............
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
delete.
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a static method. Seems like a mistake
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4588
302
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sandeep,

This question is correct. Why didn't you read the explanation provided with that question?

Ok, to avoid this confusion, please read the original question, answer and the explanation below:

Question:
Choose the available STATIC methods from the following list (choose two)

Options:
A. Thread.start();
B. Thread.setPriority()
C. Thread.sleep(int)
D. Thread.getName()
E. Thread.yield();
F. Thread.run();
G. Thread.currentThread();
H. Thread.join();

Correct Answer: EG

Explanation: Answer-C is wrong, because the method Thread.sleep(int) is NOT available! The available static method is Thread.sleep(long). (Pay attention for the method signature).


Hope you can understand.

Cheers,

Devaka.
 
Ivan Ivanic
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that sure puts some light to the problem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic