Home > Java Programming > Quizzes > Java Basics Practice Test: java.util &The Collections Framework
Java Basics Practice Test: java.util &The Collections Framework
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 53% Most missed: “What will be the output of the following Java program?”
Quiz on java.util concepts including maps, array list, hash set, tree set, linked list, stacks, vectors, dictionary and hash table, rmi, iterators, collection framework overview, collection interface and algorithms. The java.util package is a part of the Java programming language that contains a collection of interfaces and classes that can be used to store and manipulate groups of objects. The Collections Framework provides a unified architecture for storing, retrieving, manipulating, and searching collections of objects. The Collections Framework is a hierarchical structure that consists... Show more
Java Basics Practice Test: java.util &The Collections Framework
Time left 00:00
25 Questions

1. What will be the output of the following Java program?
import java.util.*;
class Bitset
{
public static void main(String args[])
{
BitSet obj = new BitSet(5);
for (int i = 0; i < 5; ++i)
obj.set(i);
obj.clear(2);
System.out.print(obj);
}
}
2. Which of these methods are member of Remote class?
3. Which of the below does not implement Map interface?
4. Which of this interface is not a part of Java’s collection framework?
5. Which of this method is used to change an element in a LinkedList Object?
6. Which of these iterators can be used only with List?
7. Map implements collection interface?
8. Where does a new element be inserted in linked list implementation of a queue?
9. What happens if we put a key object in a HashMap which exists?
10. What is the default clone of HashSet?
11. What is the premise of equality for IdentityHashMap?
12. Which of this method is used to make all elements of an equal to specified value?
13. Do we have get(Object o) method in HashSet.
14. Which of these method is used to insert value and its key?
15. Which of these classes provide implementation of map interface?
16. What will be the output of the following Java program?
import java.util.*;
class Output
{
public static void main(String args[])
{
ArrayList obj = new ArrayList();
obj.add("A");
obj.add(0, "B");
System.out.println(obj.size());
}
}
17. Which of these is a method of class Date which is used to search whether object contains a date before the specified date?
18. Which of these object stores association between keys and values?
19. What will be the output of the following Java code?
import java.util.*;
class stack
{
public static void main(String args[])
{
Stack obj = new Stack();
obj.push(new Integer(3));
obj.push(new Integer(2));
obj.pop();
obj.push(new Integer(5));
System.out.println(obj);
}
}
20. Which of these Exceptions is thrown by remote method?
21. Which of these class is used for creating a client for a server-client operations?
22. Which of these standard collection classes implements all the standard functions on list data structure?
23. Which of these method Map class is used to obtain an element in the map having specified key?
24. What is Remote method invocation (RMI)?
25. What will be the output of the following Java code?
import java.util.*;
class Bitset
{
public static void main(String args[])
{
BitSet obj = new BitSet(5);
for (int i = 0; i < 5; ++i)
obj.set(i);
System.out.print(obj.get(3));
}
}