Which statement is true?

Options
- HashTable is a sub class of Dictionary
- ArrayList is a sub class of Vector
- LinkedList is a subclass of ArrayList
- Vector is a subclass of Stack


CORRECT ANSWER : HashTable is a sub class of Dictionary

Discussion Board
explanation

plz explain more..

snehal chavan 04-5-2017 04:26 AM

i hope that i have done best

Nice

Madhavi 09-9-2016 12:23 PM

Hashtable subclass of dictionary

Hashtable uses put() and get() to add and retrieve key and value pairs. Hashtable allows hiding of key-value pairs. It keeps an array of key/value pairs. Whenever a new key/value pair is added in the table then it is added in the array at an index which is calculated by the hashcode of the key. If at that point of time key/value pair exists at that index then the new pair will be linked to the existing key/value pair. So, it can be said that it is a structured way to represent linked list. Dictionary class is the abstract parent class for hashtable which is used to map keys to values.

Therefore hashtable class is a concrete subclass of dictionary that build the complete table of key/value pairs. For example:

public class java.util.Hashtable extends java.util.Dictionary
implements java.lang.Cloneable, java.io.Serializable{

//statements...

}

Rohit Sharma 07-29-2014 01:41 AM

link between hashtable and Dictionary

Can You please explain how "Hashtable" is a subclass of "Dictionary" along with one Example.

Soujanya D 12-13-2013 10:23 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