Implementing Object-Oriented Relationships: A home is a house that has a family and a pet. : Inheritance « Object Oriented « SCJP






public class MainClass {
  public static void main(String[] argv) {
    System.out.println();
  }
}

class House {

}

class Family {
}

class Pet {
}

class Home extends House {
  Family inhabitants;

  Pet thePet;
}








6.3.Inheritance
6.3.1.Using inheritance (the "is a" relation).
6.3.2.Implementing Object-Oriented Relationships: A home is a house that has a family and a pet.