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 |
How do constructors use this() and super()?
Explain the difference between jvm and jre?
Can we call a non-static method from inside a static method?
Is space a string in java?
What are the OOAD concepts in java explain with examples?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
Can we override the static methods?
how to fing linkedlist is circular or not?
who can we create the object of a class? in how many ways we can create it (max 5)
What is difference between add() and addelement() in vector?
What is garbage collector?
whst is encapsulation?when u encpsulate actually while devoloping code?