1D Arrays
March 21st, 2016
Lecture Code
1D Arrays - Review
- Declaration, e.g. int[] census;
- Allocation, e.g. census = new int[2016];
- Access, e.g. census[2015]
- Size, e.g. census.length
- Initialization
- for each looping, e.g. for (int censusForYear: census) { ... }
- Slides
- Oracle Documentation
Class Exercise
Define a function that can sort an array of integers.