Collections

  • 13
  • 未開放
Collections

13
問卷/小測驗
Collections,等級 13,課堂 6
未開放
Collections
Collections
留言 (3)
  • 受歡迎
你必須登入才能留言
Jimmy
等級 28 ,Lausanne,Switzerland
29 五月, 07:31
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);
Harshit Garg
等級 23 ,Chandigarh,India
Expert
3 十一月 2023, 18:24
What method should be used to remove an element from the middle of an ArrayList?
Kingpvz
等級 31 ,Slovakia
30 十一月 2024, 08:58
neither of the answers they provided is correct