Which of these statements is true?

Options
- LinkedList extends List
- AbstractSet extends Set
- HashSet extends AbstractSet
- WeakHashMap extends HashMap


CORRECT ANSWER : HashSet extends AbstractSet

Discussion Board
HashSet

Hashset implements the Set interface, which is in the hashtable and it an HashMap instance gets created. It doesn't gurantee the iteration order as well as consistency of the order over the period of time. It allows the null element to be used and passed to methods. HashSet provides constant time performance for the basic operations (add, remove, contains and size), assuming the hash function distributes the elements properly among the buckets.

public class HashSet<element>
extends AbstractSet<element>

Rohit Sharma 07-29-2014 02:08 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement