Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of these packages contain all the collection classes?

  • A.java.lang
  • B. java.util
  • C.java.net
  • D.java.awt

Answer: B

Correct answer: java.util

The collection framework - List, Set, Map and their implementations, along with Collections, Arrays and the iterators - lives in java.util. It must be imported explicitly, unlike java.lang, which is imported automatically and holds the core language types such as String, Object and the wrappers.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.