• 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

A J@whiz 1.4 question

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thread priority range is:
A) 0-5
B) 1-10
C) 1-4
D) -5-5
E) None of these
The answere is B : 1-10. However, according to K&B's book, the thread priority is platform dependent, even though in Sun's JDK 1.4 it is defined from one to ten, it might not in other JVMs. Therefor I chose E (None of these).
My qustion is: suppose this very question appear in my real exam, which one should I choose?
Thanks in advance!
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
B. I think what K&B meant was that even though you can specify 1 thru 10, some JVM implementations might *internally* have only from 1 to 5. that means that if you declare 1 thread with priority 6 and another thread with priority 7, they might end up having the same priority. That's the reason you must not rely on thread priorities.
again, answer B is correct
HTH
[ October 03, 2003: Message edited by: Andres Gonzalez ]
 
Dep Joy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, not much convinced though, but if it does appear, I will follow the consensus.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic