/* * Demonstrates inheritance and polymorphism */ public class TestInheritance { public static void main(String[] args) { Student stud = new Student("Amy","Winters",1990,"Computer Science",4.0); Instructor inst = new Instructor("Steve","Smith",1960,"Unit 4",70000); Person p; p = stud; // p now references a Student object System.out.println("Printing student: "+p.toString()); p = inst; // p now references an Instructor object System.out.println("Printing instructor: "+p.toString()); } }