Object
When you write a class, you’re describing how the JVM should make an object of that type.
Array
- quite primitive compared to those found in other languages (like Javascript)
- fixed size once created
- memory location for the array is contiguous
- can create an array with specific size with
int array[] = new int[size];
- no
indexOf()
method
ArrayList
- dynamic in size
- capable of storing different types in the same list
- requires more memory to store the elements as well as more time to iterate
usage:
ArrayList myList = new ArrayList();
myList.get()
myList.Add ("Delhi");
- create with ``
- elements accessed with ``
- elements added with ``