public class KontoTest { public static void main(String[] args) { Konto k1 = new Konto(); // Neues Konto einrichten System.out.println(k1.kontoinhaber); // Kontoinhaber ausgeben k1.saldo_euro = 1000; // Anfangswert 1000 EUR Kontostand System.out.println("Kontostand: " + k1.saldo_euro); // und ausgeben Konto_erweitert k2 = new Konto_erweitert(); // "Advanced" Version // k2.saldo_euro = 1000; // Geht nicht, da saldo_euro private! System.out.println("Kontoinhaber: " + k2.kontoinhaber); // kontoinhaber ist protected, in der gleichen Package sichtbar System.out.println("IBAN: " + k2.iban); // iban ist protected, in der gleichen Package sichtbar int[] ks = k2.kontostand(); System.out.println("Kontostand: " + ks[0] + "EUR, " + ks[1] + "Cent"); } }