CS3401 Quiz 6

Which of the following are the three major categories of Java Collections?
Correct Response
lists, sets, maps
hash tables, hash maps, hash sets
arraylists, linkedlists, vectors
trees, lists, maps
A collection that does not impose a positional order on its elements, and does not allow duplicates is called which of the following?
A hashmap
A linkedlist
A vector
Correct Response
A set
A collection whose elements are pairs of keys and values is called which of the following?
An iterator
Correct Response
A map
A binary tree
A heap
Ideally, the hash codes of two objects should be which of the following:
Incorrect Response
The should be equal when the objects belong to the same class, and different when the objects belong to different classes
They should be equal when the objects are of the same type, and different when the objects are of different types
Correct Answer
They should be equal when the objects have equal values, and different when the objects have different values
None of the above, because it doesn't matter if they are equal or different
collision occurs in a hash table when which of the following happens?
Objects whose class types are different have the same hash code
Objects whose class types are the same have different hash codes
Objects of the same class and with different values have different hash codes
Correct Response
Objects of the same class and with different values have the same hash code

Popular posts from this blog

CS3401 Practice Quiz 2 Part 2

CS3401 Practice Quiz 2 Part 1