// // Illustrate Polymorphism // // PolyDemo.java // // Goal: use two classes: Person and Stduent ... // import java.util.Scanner; public class PolyDemo { public static void OutWrite(Person aPerson) { System.out.println(aPerson); } public static void main(String[] args) { Scanner kb = new Scanner(System.in); Person one = new Person(); Student another = new Student(); String name; int number; System.out.print("The person's name? "); name = kb.nextLine(); one.setName(name); System.out.print("The student's name? "); name = kb.nextLine(); System.out.print("The student's number? "); number = kb.nextInt(); another.reset(name, number); OutWrite(one); OutWrite(another); } }