You are here
Home >

Which of these packages contain all the collection classes in the Java Collection Framework?

B) java.lang
C) java.util
D) java.awt

Answer: C) java.util


  • focuses on input/output operations and doesn’t contain collection classes.
  • java.lang contains fundamental classes like Object and String, not collection classes.
  • java.util is the primary package containing all the core collection framework classes and interfaces, including ArrayList, HashMap, HashSet, LinkedList, List, Set, Map, etc.
  • java.awt deals with the graphical user interface (GUI) components and doesn’t contain collection classes.