import java.util.Arrays;

/**
   Example from Core Java 8th edition by Horstmann and Cornell 
 */ 
public class PersonTest {
    public static void main(String[] args){
	// cannot instantiate a Person object but can declare Person variables
	Person[] people = new Person[4]; 

	people[0] = new Employee("Harry", 20000); 
	people[1] = new Student("Tom", "Computer Science"); 
	people[2] = new Student("Zack", "Political Science"); 
	people[3] = new Employee("Alan", 30000);

	Arrays.sort(people); 

	for(Person p : people) 
	    System.out.println(p.getName() + ", " + p.getDescription()); 
    }
}