Core Java Quiz 3 – Collections Framework A collection is an object that represents a group of objects. A collections framework is a unified architecture for representing and manipulating collections, enabling collections to be manipulated independently of implementation details. Reference - Official Javadoc Let's learn about the Collections framework by answering some questions below. 1. Which interface below is the root of the collection hierarchy? List Set Map Collection 2. Class LinkedList implements below interface/s? List Queue List & Deque both Set & Queue both 3. What is common between List and Set in Collections Framework? Both are classes. Both are interfaces. 4. Which statement is not correct about List? List is an interface. List is an ordered collection. An element of List can be accessed using its index. List does not allow duplicates. 5. Which statement is not correct about Set? Set is not a class. We can not get an element of Set using index. Set does not allow duplicate elements. Set can store more than one null elements. 6. Tick all correct implemented classes of List from below? ArrayList LinkedList Vector Stack 7. Tick all correct implemented classes of Set from below? LinkedHashSet HashSet SortedSet NavigableSet 8. Which method can be used to check if a collection has no elements? isNull() isEmpty() empty() None 9. Which method is used to get number of elements present in a collection? length() size() length None 10. Which method is used to delete all elements from a collection? delete() clear() removeAll() None Time is Up! Author: Amod MahajanA software Tester who is paid to judge products developed by others. Currently getting paid in American Dollars. Writing technical posts and creating YouTube videos are my hobbies. Share this:Click to share on Twitter (Opens in new window)Click to share on Facebook (Opens in new window)Like this:Like Loading... Related Skip back to main navigation
Awesome