← Java Programming learning pathJava Programming · Module 8 of 10
Arrays, Strings and collections
Store groups of data with arrays and the Collections Framework.
📖 Key ideas
- Arrays have a fixed size: int[] marks = new int[5];
- String is immutable; StringBuilder is efficient for building text.
- ArrayList grows automatically: list.add("A").
- HashMap stores key-value pairs: map.put("Asha", 90).
- HashSet stores unique values; use generics like List<String>.
💡 Real-life example: An array is a fixed train with 5 coaches; an ArrayList is a train that adds coaches when needed.
ArrayListResizable list
HashMapKey-value store
HashSetCollection of unique items
StringBuilderMutable text builder