diff --git a/resources/AllgemeinTest/List.jav b/resources/AllgemeinTest/List.jav new file mode 100644 index 00000000..9c612f2d --- /dev/null +++ b/resources/AllgemeinTest/List.jav @@ -0,0 +1,46 @@ +import java.lang.Boolean; +import java.lang.Object; + +class List { + elem; + next; + + List() { + super(); + } + + List(elem, next) { + this.elem = elem; + this.next = next; + } + + addElement(newElem) { + return new List(newElem, this); + } + + append(l) { + if (next == null) { + return l; + } + else { + return new List(elem, next.append(l)); + } + } +/* + addAll(l) { + var nextLoc = next; + while (//nextLoc != null + true) { + nextLoc = nextLoc.next; + } + nextLoc = l; + } + + void m() { + List l; // = new List(1, null); + List l2; // = new List("SSS", null); + l.addAll(l2); + } +*/ +} +