Professional Documents
Culture Documents
AP CSA Unit 6 Notes
AP CSA Unit 6 Notes
AP CSA Unit 6 Notes
- **Unit 6**
- arrays
- `public final int length` is a field in each array with the length
(not 0-indexed), like `str.length()` for String
- initalized with
- `int[] arr = new int[5];`
- `arr[1] = 1;`
- `arr[2] = 2;`
- etc
- or with an initializer list
- `int[] arr = {1, 2, 3, 4, 5}`