From c9de4120b1fe9d533e3ee25f11ffdb4c1d4c5910 Mon Sep 17 00:00:00 2001 From: student Date: Wed, 1 Apr 2026 13:31:55 +0200 Subject: [PATCH] --- PR2pvl/src/Knoten.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/PR2pvl/src/Knoten.java b/PR2pvl/src/Knoten.java index f2ee050..6475ba3 100644 --- a/PR2pvl/src/Knoten.java +++ b/PR2pvl/src/Knoten.java @@ -22,21 +22,19 @@ public class Knoten { public int auslesenAnPos(int pos) throws Exception { int r = 0; + // sind wir bereits an der Pos angekommen? if(pos >0 && nachfolger !=null) { pos--; nachfolger.auslesenAnPos(pos); } - else { - r= this.wert; - return r; - } if(nachfolger==null && pos>1) { throw new IndexOutOfBoundsException("Illegal Statement"); } - - - return r; + else { + r= this.wert; + return r; + } }