| Author |
overriding
|
srinivas sridaragaddi
Ranch Hand
Joined: Jul 24, 2007
Posts: 225
|
|
options: prints:AAA prints:ABC prints:CCC compile time error run time error output:AAA but i was expecting it be CCC
|
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
The method m1 in class B does not override the method m1 in class A, and the method m1 in class C does not override the method m1 in classes A and / or B. Because the types of the arguments are different in the three m1 methods, these are not overridden methods, so method call polymorphism does not apply here.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: overriding
|
|
|