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

Thread

 
Kaleem Haqqi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which two CANNOT directly cause a thread to stop executing?
a. exiting from a synchronized block
b. calling the wait method
c. calling the notify method on an object
d. calling a read method on an InputStream object
e. calling the setPriority method on a Thread object
I choose d and e. Am I right?
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Guess , Ans a) n e) are correct
b) Calling wait method 'll stop da Thread , until its notified on da same object
c) Calling notify on some object , CAN stop current thread , if there are any other Thread(s) to be notified , waiting on same object
d) Read() n write() methods in Streams are Blocking , it means they do not return until done their job
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Ragu Sivaraman
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yes i do think a and e are correct
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic