Inheritance in Java
  • Java Classes are organized in Package
  • Classes can be grouped as a Class Library. In another word, the clas library is made up of related classes, which are often called Java API. Swing is an example of Java API, and String class is a part of Java Standard class library. Java_APIs
  • To use these classes in the current run time, we must provide fully qualified names or use an import declaration.

All the sub classes will inherit the behavior of the main or super class. Unlike C++, in java multiple inheritance is not allowed

Rule of Inheritance:
  • Base Constructor (What ? ) is not inherited to sub classes. Keeps dad's wallet safe.
  • Subclass can call parent constructors