Basil Antony Xavier

Greenhorn
+ Follow
since Aug 07, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Basil Antony Xavier

Congrats...

i am just planning to prepare for the test..

i think your notes will be very useful for me

can you please send me your notes on my mail id.

basilantonyxavier@gmail.com

Thanks in advance.
Regrads,
Xavier
Hi..


i found that even if we use extends keyword

still the static methods will not be overridden in this case...


code

---------------------------------------------------------------------

public class RegTest
{
public static void main(String[] args)
{
A ob = new B();
ob.test();
A.test();

}
}
class A
{
public static void test()
{
System.out.println("done A");
}
}
class B extends A
{
public static void test()
{
System.out.println("done B");
}
}


----------------------------------------------------------------------

output

done A


but the expected output should be as


done B
nice Arul , now you have clearly explained to him with an example ....