← Java Programming learning path
Java Programming · Module 8 of 10

Arrays, Strings and collections

Store groups of data with arrays and the Collections Framework.

📖 Key ideas

  1. Arrays have a fixed size: int[] marks = new int[5];
  2. String is immutable; StringBuilder is efficient for building text.
  3. ArrayList grows automatically: list.add("A").
  4. HashMap stores key-value pairs: map.put("Asha", 90).
  5. 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