Sail E0 Webinar

MCQs

Total Questions : 16 | Page 1 of 2 pages
Question 1. Which of these packages contain all the collection classes?
  1.    java.lang
  2.    java.util
  3.    java.net
  4.    java.awt
 Discuss Question
Answer: Option B. -> java.util


java.util


Question 2. Which of these methods deletes all the elements from invoking collection?
  1.    clear()
  2.    reset()
  3.    delete()
  4.    refresh()
 Discuss Question
Answer: Option A. -> clear()


clear() method removes all the elements from invoking collection.


Question 3. Which of these classes is not part of Java's collection framework?
  1.    Maps
  2.    Array
  3.    Stack
  4.    Queue
 Discuss Question
Answer: Option D. -> Queue


Queue is not a part of collection framework.


Question 4. What is Collection in Java?
  1.    A group of objects
  2.    A group of classes
  3.    A group of interfaces
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> A group of objects


A collection is a group of objects, it is similar to String Template Library (STL) of C++ programming language.


Question 5. Which of these interface is not a part of Java's collection framework?
  1.    List
  2.    Set
  3.    SortedMap
  4.    SortedList
 Discuss Question
Answer: Option D. -> SortedList


SortedList is not a part of collection framework.


Question 6. Which of these interface declares core method that all collections will have?
  1.    set
  2.    EventListner
  3.    Comparator
  4.    Collection
 Discuss Question
Answer: Option D. -> Collection


Collection interfaces defines core methods that all the collections like set, map, arrays etc will have.


Question 7. Which of these interface handle sequences?
  1.    Set
  2.    List
  3.    Comparator
  4.    Collection
 Discuss Question
Answer: Option B. -> List


List


Question 8. Which of these interface is not a part of Java's collection framework?
  1.    List
  2.    Set
  3.    SortedMap
  4.    SortedList
 Discuss Question
Answer: Option D. -> SortedList


SortedList is not a part of collection framework.


Question 9. Which of these interface must contain a unique element?
  1.    Set
  2.    List
  3.    Array
  4.    Collection
 Discuss Question
Answer: Option A. -> Set


Set interface extends collection interface to handle sets, which must contain unique elements.


Question 10. Which of these is Basic interface that all other interface inherits?
  1.    Set
  2.    Array
  3.    List
  4.    Collection
 Discuss Question
Answer: Option D. -> Collection


Collection interface is inherited by all other interfaces like Set, Array, Map etc. It defines core methods that all the collections like set, map, arrays etc will have


Latest Videos

Latest Test Papers