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

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Object Oriented » Inheritance 
6.3.2.Implementing Object-Oriented Relationships: A home is a house that has a family and a pet.
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.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.