What are 2d-arrays/modeling?37
  • Multi-dimensional array: an array of arrays, e.g. a grid
  • Access with arr[row][col]
  • Modeling: representing a real (or imagined) thing as objects -- using instance variables to model the state of things and methods to model behavior
  • 2D arrays are useful for anything "grid like" -- e.g. a game board or a spreadsheet of data.
  • Before a variable is assigned, if it is non-primitive, it's value is the null value. If a method is called on null an error will be thrown.