//InheritanceDemo.java

public class InheritanceDemo
{
    public static void main(String[] args) 
    {
        Student s = new Student();
        s.writeOutput();
        System.out.println();

        s.setName("Warren Peace");
        s.setStudentNumber(1234);
        s.writeOutput();
        System.out.println();

        Person p = new Person();
        p.writeOutput();
        System.out.println();

        Person pp = new Student();
        pp.writeOutput();

        Student pp = new Person();  //illegal  Why?
    }
}
