Podcast Episode 8 – Arrays

by Trevor Page on November 29, 2012

Play

Why Arrays are Useful

  • Bunch of variables smashed together in an organized fashion
  • Reduces the number of variables you’ll need to use
  • Can be sorted

Things to Note

  • Arrays have a different syntax than just creating a bunch of variables
  • You can cause errors by going outside the boundaries of Arrays (ArrayIndexOutOfBoundsException)
  • Arrays come in different forms: Arrays and ArrayLists
    • Arrays need to have their size defined before you can use them
    • ArrayLists don’t need their size defined and can grow and shrink dynamically
  • Arrays are zero based (i.e. an item at position 0 is actually the FIRST item in the array, item at position 1 is the second and so on)

Multi-dimensional Arrays

  • Remember math class? Think of them like a matrix

Homework:

Read http://howtoprogramwithjava.com/java-arrays/

5 Tips to Becoming a Better Programmer
Easy to Understand
Easy to Implement
Extremely Useful

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: