Home » JAVA Programming » Data Structures » Question
  1. What does Collections.emptySet() return?
    1. Null object
    2. The type of Set depends on the parameter passed to the emptySet() method
    3. Mutable Set
    4. Immutable Set
    5. None of these
Correct Option: D

Immutable Set is useful in multithreaded environment. One does not need to declare generic type collection. It is inferred by the context of method call.



Your comments will be displayed only after manual approval.