Gari Jain wrote:
The notify() method is used to send a signal to one and only one of the
threads that are waiting in that same object's waiting pool.
then when i run this code..how come all the readers are notified?
Jim Hoglund wrote:
I'm still confused about the meaning of "main thread". Can you explain further?
Jim ... ...
Shanky Sohar wrote:It could also be compiler error because they donot give the assumption for import statement...
and code given by you requires following
statement........
Dieter Quickfend wrote:I can't give the full question, because it's in the exam engine and I can't copy it, but basically, to summarize:
"if x5.equals(x6) == true, which of the following statements will always be true?"
Correct answer:
C: x5.hashCode() == x6.hashCode();
Explanation: By contract, if .....
...What did I miss? By contract? That wasn't in the question...
Jim Hoglund wrote:Divyeshh : In the first post the wait() was on an object that extends Thread,
not the "main" thread. So I think the mystery notify() is a behavior of type
Thread. We should study Thread to find the answer.
Jim ... ...
Or is it that notify() is automatically called when the run method finishes?
mohitkumar gupta wrote:
in the above code,animals of type is passed to addAnimal method that is supertype of Dog.then why not in the First Problem i posted
mohitkumar gupta wrote:
2.why do line 22 ,21 give error ?
list is of Horse Type,then why such error
mohitkumar gupta wrote:
3.why the casting is required in the line 42 but not in 28?
Seetharaman Venkatasamy wrote:
Divyeshh Patel wrote:Though it does not harm replacing line 24, but it is unnecessary as far as the question is concerned(just making use of generic types)
if you were not apply generic, then there is a possibility to put any Object into Map right? example : aMap.put(key, new Object()); where in generic only you can put Integer or its subclass
hth