1) There are 10 different threads in runnable state. Each
having priority 1 to 10. How does the CPU schedules or
executes these threads?
Answers were Sorted based on User's Feedback
Answer / karthik
We are not sure about when a thread runs it depends upon the
thread scheduler which can able to run a thread at any time
so the priorities are not sure even if we use the
setpriority method for a thread : ref scjp book thread chapter
Is This Answer Correct ? | 10 Yes | 3 No |
Answer / shiv
At any given time the highest priority thread will always
be in a execution state. if there are more than one threads
with same priority then JVM decides which one should be
executed first. Thus if the priority is from 1..10 the they
will be scheduled for execution in a reverse manner.
Is This Answer Correct ? | 10 Yes | 4 No |
Is null a string in java?
What is Hierarchy of exception?
When throw keyword is used?
Which browsers work with java?
What is java class writing rules?
What is java in layman terms?
What are Advatages of Overloading and Overridding.
What is output buffer?
What do you mean by object?
What do you mean by an object in java?
Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?