public class Keller { private static class KellerEintrag{ Object inhalt; KellerEintrag naechster; } private KellerEintrag top; public Keller(){ top=null; } public boolean empty(){ return top==null; } public void push(Object wert){ KellerEintrag eintrag = new KellerEintrag(); eintrag.inhalt=wert; eintrag.naechster=top; top=eintrag; } public Object top(){ if(empty()) System.out.println("in top: Keller leer"); return top.inhalt; } public void pop(){ if(empty()) System.out.println("in pop: Keller leer"); top=top.naechster; } public void nop(){ } }