Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

overriding method with different return type

807607Oct 27 2006 — edited Nov 8 2006
Hallo,

I found that it's impossible to override a method with different return type. Is there any alternatives to do so? Maybe some tricks???
At least to change the return type to the subclasses.
I mean if class A has method of getX() which return of type class X.
I want to override the method getX() in class subA to return of type class subX.

Regards,
Heru

Message was edited by:
herusalim
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2006
Added on Oct 27 2006
13 comments
2,753 views