kaku kohli

Greenhorn
+ Follow
since Oct 02, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by kaku kohli

Yeah its correct.
If reader thread enters wait on calculator first and then calculator executes, it notifies reader to stop waiting.
got it now. thanks
i guess i needed to think a little more
Hello,
Here is a wait/notifyAll code I wrote getting idea from SCJP Kathy Sierra book.




I used while loop with boolean for ensuring "if notifyAll() executes before wait(), threads doesn't keep on waiting."

Lets assume 3rd Reader thread executes before calculator thread and enters wait on calc.
then calculator executes.
then why Reader thread not keep waiting due to wait() ?

Reply asap if possible. thanks
Hello,
Check out this code about passing reference of an object of a method local inner class.



Hope it helps.


why in output i1 != i2 but i3==i4 ?
11 years ago
Thanks Campbell Ritchie..
I understood that Java Language Specification section.
Specially this line in Java Language Specification section:
A method m1 is strictly more specific than another method m2 if and only if m1 is more specific than m2 and m2 is not more specific than m1.

In my code, each method is not more specific than the other one. I have to make a method more specific to make my code work.
12 years ago
Ilja Preuss and Corey McGlone thanks for the accurate explanation you have given...
i totally understood it.
please help me with this similar problem i got stuck with..



i am expecting it to produce following output:

BMW getmodelno long... i

because widening is preferred by the compiler over autoboxing/unboxing

but i am getting compiler error:
reference to getModelno method is ambiguous..

please tell me how can it be...?
12 years ago