Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

gihan dissanayaka

+ Follow
since Sep 03, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by gihan dissanayaka

My opinion is only you have to change the order of starting threads to get what you want

if you are using notify() that means you are calling to thrads which are waiting.
if you start thread 1 first what happens when it meets the this.notify()???
it is notifying to waiting threads.but there's none
it's because you can't override static final methods .
i'm coming too
10 years ago
ya , i also get error in line no4
because that line try to override get() method with return type N but in superclass returntype is M.
and then if we correct the returntype there willbe error saying that there is no overiding because returning same .
so there is no overriding .
so we have to do some radical changes in this program if it wants to run.
but we can run it without line 4 because no need of that line we can use superclass method .

thats what i get .
arun,i think this two array initialisations is same .only two ways of expression.
ya this is prints 11.but i don't know count is static or not.
@ankit- why you are saying count is not static

ket bhav wrote:When

B ref2 = (B) ref1;

reference ref1 will be cast to class B.
so B's method will be called.

And class B's

public int g() { return f(); }

will call method of class B.

if that might not exist then an only it will try to find from super class that is class A.
But in this case f() exist in class B so it will return 1.

dear ket, i think when you dide casting you are not pointing to that class see that below it can still access to sub class. i think what happens is it only limited to the methods which caseted class have