• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The Question in The Mock Exam Confued Me

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 on an object
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
The answer is "CE"
But I think the answer is "AC".Because I think "exiting from a synchronized block" can do nothing to stop a thread.Am I right?
 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the answers are A, C and E, although the option E is ambiguous.
It does not say if setPriority is called on the current thread or another thread, nor does it say if the priority is increased or decreased.
If you found this in a mock exam, you can always send and email to the author.
HTH
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic