new file: ../../AllgemeinTest/List.jav
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 2m46s
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 2m46s
This commit is contained in:
parent
e37040f367
commit
4b110244f2
46
resources/AllgemeinTest/List.jav
Normal file
46
resources/AllgemeinTest/List.jav
Normal file
@ -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<? extends Object> l; // = new List<Integer>(1, null);
|
||||
List<? extends Object> l2; // = new List<String>("SSS", null);
|
||||
l.addAll(l2);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user