aspose file tools*
The moose likes Beginning Java and the fly likes extending class clarifications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "extending class clarifications" Watch "extending class clarifications" New topic
Author

extending class clarifications

Randy Smith
Ranch Hand

Joined: Mar 27, 2011
Posts: 44

Thanks for responding. While i understand multiple classes inheritance is not legal, but can I confirm cascading inheritance is fine?

Legal



Illegal
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

Sure, go ahead. You can confirm it by seeing what the compiler does when you ask it to compile those pieces of code.
Randy Smith
Ranch Hand

Joined: Mar 27, 2011
Posts: 44
Paul Clapham wrote:Sure, go ahead. You can confirm it by seeing what the compiler does when you ask it to compile those pieces of code.


I have already confirm that cascading inheritance is fine. just want to reconfim this. Thanks!
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Yes.

Consider that you are already doing this whenever you extend another class, because java.lang.Object is at the top of the hierarchy. (See Java Tutorial - Subclasses.)


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: extending class clarifications