Summary of Arrays
Arrays
- All arrays are objects (you have to declare, instantiate, and initialize)
- Arrays are either arrays of primitive elements (e.g. int) or arrays of objects (really references to objects)
- Arrays are statically sized: you
can’t change length after
Use Array.length in for loops
to avoid “off-by-one” errors
- 2D arrays are arrays of arrays
Don’t go yet, there’s one