8. What method should be used to remove an element from the middle of an ArrayList?
ArrayList<String> list = new ArrayList<>();
list.add("Apple");
list.add("Banana");
list.add("Cherry");
list.add("Date");
// Remove the element at index 2 ("Cherry")
list.remove(2);
// Resulting list: ["Apple", "Banana", "Date"]
System.out.println(list);