class Uke3 { public static void main(String[] args) { Person person1 = new Person("Roger", 40); Student student1 = new Student("Kaare", 212, 2004491); Person student1Person = student1; // System.out.println(person1.hentNavn()); // System.out.println(student1.hentNavn()); // Person student2 = new Student("Bengt", 34, 0131223); // System.out.println(student1.hentStudentID()); System.out.println(( (Student)student1Person ).hentStudentID()); Person[] personListe = {person1, student1, student2}; System.out.println(((Student)personListe[1]).hentStudentID()); Object[] objekter = new Object[10]; int indeks = 0; for (int i = 0; i < personListe.length; i++) { if (personListe[i].hentNavn().equals("Kaare")) { indeks = i; } } System.out.println(indeks); System.out.println(person1 instanceof Student); System.out.println(student1 instanceof Person); } }