gihan dissanayaka

Greenhorn
+ Follow
since Sep 03, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by gihan dissanayaka

My opinion is only you have to change the order of starting threads to get what you want
t2.start();
t1.start();

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
@JJ
it's because you can't override static final methods .
congrats.
i'm coming too
6 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