kleiner fortschritt

main
student 2026-04-01 13:14:54 +02:00
parent 2c895010ba
commit e7b26cb1cd
1 changed files with 16 additions and 5 deletions

View File

@ -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 static void einfügen(int zahl) { public LinkedList(int begin) {
this.begin = begin;
}
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);
}
} }
}