Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Subclass Vs Superclass

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
What is difference between subclass and superclass?
Thanks in advance,
Angela
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a very simple example...

In this example, when you speak of "Father", "Grandfather" is the superclass. It's the class that Father inherits from. In this example, any objects of type Father have both GFMethod and FMethod.
When you speak of "Grandfather", "Father" is the subclass.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic