Learning objectives
Explain that Integer and Double are immutable wrapper classes holding an int or a double as an object, and identify where Java autoboxes a primitive and unboxes a wrapper automatically
Convert a String to a number with Integer.parseInt and Double.parseDouble, and explain why an ArrayList of numbers is declared with Integer or Double rather than int or double
Declare and create an ArrayList with a type parameter, and use size, add, get, set and remove, stating what each returns and how the index forms of add and remove shift the other elements
Traverse an ArrayList with an indexed for loop, a while loop and an enhanced for loop, and explain why removing elements in a forward indexed loop can skip an element
Explain the ConcurrentModificationException raised when an ArrayList changes size during an enhanced for loop, and the IndexOutOfBoundsException raised by an invalid index
Compare an array with an ArrayList on fixed or changing size, on the syntax for reading and writing elements and on the storage of primitive values
Continue with a revision plan
These learning objectives are available to everyone. Sign in with an eligible plan to read the full note and worked examples.
