Unit 7 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.
Different from arrays, as it provides more felxibility about adding, and deleting items from the list.
Traverse an ArrayList
- can use any type of loop to go through an array, and also to go in reverse.
- Traversing through as array list can be done with loops and recursion loops
- Enhanced for-loop can be used as well
Developigng Algorigthms using Arrays:
- Uses of ArrayList is finding the minimum and maximum of an array list
- Example of how an array list is created:
ArrayList