Unit 6 Notes
Primitive data - int, double, float Non primitive - String, Integer, class
In java, you need to declare and initialize, like shown: example: int[] int = new int[10]
Errors: Accessing values where the element does not exist.
Traverse an Array
- can use any type of loop to go through an array, and also to go in everse.
Developigng Algorigthms using Arrays:
- array_name.length gives the length of the array
- array_name[i] accesses the ith element of the array