File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes overriding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "overriding" Watch "overriding" New topic


srinivas sridaragaddi
Ranch Hand

Joined: Jul 24, 2007
Posts: 225


compile time error
run time error

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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15046

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 8 API documentation
I agree. Here's the link:
subject: overriding
It's not a secret anymore!