StaticSub class is only redifining method "static void m1()" not overriding although it seems like that at first look
StaticSub obj=new StaticSub(); obj.m1(); Is same as StaticSub.m1();
so should print "from StaticSub"
Joined: Feb 26, 2006
Thank you, If i replace obj1.m1() and obj1.m2() with StaticSub.m1() StaticSub.m2() resp. It is giving compiletime error ,it is fine. But what i am trying to ask you is that difference and suppose if i want to test whether static methods are overriden or not what changes should i make in my code. thanks a lot
Joined: Feb 27, 2006
You can try something like this in previous code to get a clear picture whats going on