Collections in Java
Collection types
Static vs Dynamic
- Static data types: the size does NOT change along program execution
- Integers, doubles, strings, arrays...
- Remember: strings don't change the size, we create new strings instead
- Dynamic data types: size changes along program execution
- We can easily add/remove elements
Collection types in Java
- Lists: values ordered by numeric index
- Stacks and queues are special types of lists
- Maps: values associated with keys
- Sets: no repeated values
- Trees: special relationship between certain nodes
- Most of them belong to java.util package
Collections in Java Collection types