//johnsjava.webs.com public class TestInherit { public static void main(String[] args) { Person p = new Person("Sam"); System.out.println(p.name); Student s = new Student("Nick", 1234); s.printTag(); Teacher t = new Teacher("John", s); t.printTag(); System.out.println(s instanceof Person); System.out.println(s instanceof Student); System.out.println(t instanceof Teacher); System.out.println(((Student)p) instanceof Student); } }