1

Why "t" letter is written in small while writing 'Hashtable' syntax name. why "t" is not a capital tetter like "M" in HashMap & "S" in HashSet?

  • I doubt anybody, other than the original designers of the API could seriously answer that questions. May be the developer whose task it was to write `Hashtable` had a broken `t` key...? – MadProgrammer Aug 04 '14 at 07:36
  • 4
    Hashtable and Vector predate the standardized Collections API. And, because it is. – Elliott Frisch Aug 04 '14 at 07:36

3 Answers3

3

HashMap, TreeMap are implementation of Map interface, so Hash-Map and Tree-Map as HashSet & TreeSet are implemenataion of Set interface.

But Hashtable is not implementation of Table. Hashtable is in java since jdk1.0 and it was -

public class Hashtable extends Dictionary implements Cloneable, Serializable{
}
Subhrajyoti Majumder
  • 40,646
  • 13
  • 77
  • 103
1

Take a look at how class name define in Hashtable in Java

public class Hashtable<K,V>
extends Dictionary<K,V>
implements Map<K,V>, Cloneable, java.io.Serializable {}

This is not really a question I think, By design they name their class as Hashtable.

This may did intentionally, since Map and Set are interfaces. Table is not.

Map is a interface while HashMap is a implementation of it.

Set is a interface while TreeSet is a implementation of it.

But

There is not interface call Table only a class Hashtable

Ruchira Gayan Ranaweera
  • 34,993
  • 17
  • 75
  • 115
1

Since Map and Set are interfaces and hence HashMap and HashSet have capitals... and there is no such collection interface named Table as such..

Full conversation

dddkk
  • 85
  • 1
  • 9