Arrays

These work the same as an array in most programming languages. They are of fixed size and a single type.

Defaults

  • Reference types -> null
  • boolean -> false
  • double or float -> 0.0
  • int -> 0

Using arrays

  • .length is the length of the array
  • Traverse them using a loop

Other notes

For-each loops (enhanced for loops) can be used to iterate through an array.

Using Arrays