code segment
5 Matching Annotations
- Mar 2025
-
runestone.academy runestone.academy
- Feb 2025
-
runestone.academy runestone.academy
-
o use an ArrayList instead
)%3B%0A%0A++++++++//+remove+item+0+and+move+everything+down%0A++++++++//++(this+can+be+done+in+one+method+call+with+ArrayList)%0A++++++++/toDoList%5B0%5D+%3D+toDoList%5B1%5D%3B%0A++++++++toDoList%5B1%5D+%3D+toDoList%5B2%5D%3B%0A++++++++toDoList%5B2%5D+%3D+%22%22%3B%0A/%0A+++++++toDoList.remove(0)%3B%0A%0A++++++++System.out.println(%22Here's+the+next+thing+to+do%3A+%22+%2B+toDoList.get(0))%3B%0A%0A++++++++//+Why+is+an+ArrayList+better+than+an+array+for+a+toDoList%3F%0A++++++++//+Answer%3A%0A++++%7D%0A%7D%0A%0A&mode=edit)
-
It removes the value 2 at index 1
The value at the index position is removed/deleted and not the number itself.
-
-
runestone.academy runestone.academy
-
A package is a set or library of related classes
Think of packages we create in Eclipse
-
- Sep 2022
-
runestone.academy runestone.academy
-
Java assumes that if you are doing division with integers that you want an integer result
Integer division
-