class Apfel { private int wert; public void create(int neuWert) { wert = neuWert; } public void faulen() { wert -=2; } public int wertNachsehen() { return wert; } } class Birne { private int wert; public void create(int neuWert) { wert = neuWert; } public void faulen() { wert -=3; } public int wertNachsehen() { return wert; } }