dhust
1/19/2017 - 5:19 PM

This class is testing the Person super class and the Employee subclass.

This class is testing the Person super class and the Employee subclass.

public class Testing {

    public static void main(String[] args) {
  
        Person steve = new Person();
        steve.info();
    
        Person jessica = new Person("Jessica", 23, true);
        jessica.info();
    
        Employee rich = new Employee("Rich", 40, false); // constructors are never inherited
        rich.info(); // can use this method because it's inherited from the Person class
    
        Employee sam = new Employee(); // not inherited
        sam.setName("Sam"); // inherited
        sam.info(); // inherited
  
    }

}