LETS START A RIOT OOO A RIOT

This commit is contained in:
Sage The DM 2024-11-27 15:00:54 +01:00
parent 72f7a2e529
commit a491769914
22 changed files with 234 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,18 @@
public class App {
public static void main(String[] args) throws Exception {
SmartArrayList<Integer> intList = new SmartArrayList<Integer>();
SmartArrayList<String> stringList = new SmartArrayList<String>();
intList.add(10);
intList.add(20);
intList.add(5);
stringList.add("Apfel");
stringList.add("Banane");
stringList.add("Kirsche");
System.out.println("Integer-Liste:");
intList.printElements();
System.out.println("\nString-Liste:");
stringList.printElements();
}
}

Binary file not shown.

View file

@ -0,0 +1,10 @@
import java.util.ArrayList;
public class SmartArrayList<T> extends ArrayList<T> {
public void printElements() {
System.out.print("Output of the list:");
for (T object : this) {
System.out.print(" " + object + ",");
}
}
}