What are arrays/fields?21
  • Accumulator pattern: a variable declared before a loop, updated each pass to build a result
  • Array: a fixed-size list of values of one type
  • Access with arr[i]; length with arr.length
  • Instance variable: Each object instance of the same class has its own copy of each instance variable. field is a synonym. constructor: special method that runs when class is instantiated.
  • static method: called on the class itself; non-static: called on an object, can use its instance variables
  • Getters and setters protect instance variables from direct access (which is considered "best practice")