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 |
Can memory leak in java?
Features of JAVA ? In which version of java synchronizedXXX() methods are included in Collections class.
please tell me what is wrapper class in java with example ?
In a my eclipse editor if i want to switch from jdk 1.4 to jdk 1.6 how to do that???? Initially i have jdk1.4
What is the benefit of abstract class?
What is the difference between member variables initialization and assignment in a constructor?
What is a local class in java?
What is difference between abstract class & final class
What is meant by event handling?
Can a class have an interface?
JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isThreadSafe="false". Explain it? Thanks, Seenu
How many types of design patterns are there?