class MainPerson { public static void main(String[] args) { Student studentObjekt = new Student("Samuel", "it"); Person personObjekt = new Person("Jonas"); //Student stud = personObjekt; // -> FEIL, Student referanse kan IKKE gå "oppover" Person pers = studentObjekt; // Person referanse kan gå "nedover" til Student System.out.println(pers + " instanceof Person?: " + (pers instanceof Person)); System.out.println(pers + " instanceof Student?: " + (pers instanceof Student)); } }