kleiner fortschritt
parent
2c895010ba
commit
e7b26cb1cd
|
|
@ -1,20 +1,30 @@
|
||||||
|
|
||||||
public class Aufgabe1 {
|
public class Aufgabe1 {
|
||||||
|
private LinkedList list;
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// TODO Auto-generated method stub
|
LinkedList list = new LinkedList(3);
|
||||||
|
list.einfügen(3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Knoten {
|
class Knoten {
|
||||||
int zahl;
|
int zahl;
|
||||||
|
|
||||||
|
public Knoten(int zahl) {
|
||||||
|
this.zahl = zahl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LinkedList {
|
class LinkedList {
|
||||||
int begin;
|
int begin;
|
||||||
|
|
||||||
|
public LinkedList(int begin) {
|
||||||
|
this.begin = begin;
|
||||||
|
}
|
||||||
|
|
||||||
public static void einfügen(int zahl) {
|
public static void einfügen(int zahl) {
|
||||||
|
list.add(zahl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int auslesen(int index) {
|
public static int auslesen(int index) {
|
||||||
|
|
@ -26,7 +36,8 @@ class LinkedList {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(IndexOutOfBoundsException(""));
|
System.out.println(IndexOutOfBoundsException);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue