Why Wait and notify are kept in Object class although they
are used only with Thread Class
Answers were Sorted based on User's Feedback
Answer / srinivas
Since the locking mechanism happens at the Object level so
they are in Object Class.
| Is This Answer Correct ? | 21 Yes | 4 No |
Answer / chandrasekhar
wait(),notify() are worked on the objects to control the
multiple thereads,not on theread.Hence these methods are
difined object class.
| Is This Answer Correct ? | 14 Yes | 8 No |
What are the supported platforms by java programming language?
what is Thread?
What is comparable and comparator interface? List their differences
Can we assign null to double in java?
What is the driver class?
What about interrupt() method of thread class ?
what are the different access specifiers that can be used by interfaces and abstract classes? can anyone give me detailed description on this
11 Answers IBM, L&T,
How will you serialize a singleton class without violating singleton pattern?
What do you mean by JVM?
Is 0 true or is 1 true?
for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert some stmts which can give output like no.of times numbers(1-10) returned. (for example if it returns 2 then i want output how many times 2 returned) like that i want output for no's 1 - 10 how many times each no returned. */ }
How to make class immutable