class Test{
int testVariable;
Test(int testVariable){
this.testVariable = testVariable;
}
}
public class Test {
public static void main(String[] args) {
Element a = new Element(null);
Element b = new Element(a);
System.out.println(a);
System.out.println(b);
System.out.println(a.getLast());
System.out.println(b.getLast());
}
}
class Element {
private Element next;
public Element(Element next) {
this.next = next;
}
public Element getLast() {
if (this.next != null) {
return this.next.getLast();
} else {
return this;
}
}
}
this.breite=breite;// was ist unterschied zwischen beiden , folgendes