Answer : Show method is Test class Show method in Q2 class Show method in Test class Show method in Q2 class But in the main, we say : t=q and then t.show(), which means that it should print "Show method in Q2 class." and again in the second case, we say q=(Q2)t, and then q.show(), which should print "Show method in TestClass.".. Where am I worng?? Sonir
bill williams
Ranch Hand
Joined: Jan 15, 2002
Posts: 94
posted
0
because it is not 'overridden'. <quote> a subclass cannot override methods that are declared static in the superclass. In other words, a subclass cannot override a class method. A subclass can hide a static method in the superclass by declaring a static method in the subclass with the same signature as the static method in the superclass. </quote>
Yet Another SCJP2
bill williams
Ranch Hand
Joined: Jan 15, 2002
Posts: 94
posted
0
instance variables are not 'overridden' either, just in case u might not know