Table 4 shows the attributes of a Hashtable :. 为了有更详细关于这个类介绍,请查看Hashtable . For more detail about this class, check The Hashtable . Hashtable 与HashMap极其相似,但有两项限制。Hashtable is very similar to HashMap, but it has two limitations.Map描述了‘键-值'格式的集合,类似于Hashtable 。 Map describes collections of key-value pairs, similar to Hashtable . 每一个线程需要在访问该HashTable 之前等待很长时间。 Each thread will need to wait for a long time before it can access the HashTable .
除了从Hashtable 中所定义的方法,Properties定义了以下方法:. Apart from the methods defined by Hashtable , Properties define the following methods:. HashMap允许将null作为一个entry的key或者value,而Hashtable 不允许。 HashMap allows null values as key and value whereas Hashtable doesn't allow nulls. Hashtable 中除了从Map接口中定义的方法外,还定义了以下方法:.Apart from the methods defined by Map interface, Hashtable defines the following methods:. 如您所见,Hashtable 的默认容量比HashMap要稍微小一些(分别是11与16)。 As you can see, Hashtable has a slightly smaller default capacity than HashMap(11 vs. 16). Hashtable 的实例有两个参数影响其性能:初始容量和加载因子。An instance of HashMap has two parameters that affect its performance: initial capacity and load factor. 图17表明,Hashtable 的大小为11(默认大小),而且完全是空的。 Figure 17 shows that the Hashtable has a size of 11(the default size) and that it is completely empty. HashMap的key和value都允许为null,而HashTable 的key和value都不允许为null。 HashMap allows null values as key and value whereas Hashtable doesn't allow nulls. Hashtable 的实例有两个参数影响其性能:初始容量和加载因子。An instance of Hashtable has two parameters that affect its efficiency: its capacity and its load factor. HashMap允许键和值是null,而Hashtable 不允许键或者值是null。 HashMap permits null values and only one null key, while Hashtable doesn't allow key or value as null. Hashcode值主要用于基于散列的集合,如HashMap,HashSet,HashTable …etc。 Hashcode is used for bucketing in Hash implementations like HashMap, HashTable , HashSet etc. HashMap允许null键和值的存在,而Hashtable 既不允许null键,也不允许null值。 HashMap permits null values and only one null key, while Hashtable doesn't allow key or value as null. 例如,hashtable 是一个紧凑格式的复合词,应将其视为一个单词并相应地确定大小写。 For example, hashtable is a closed-form compound word that should be treated as a single word and cased accordingly. MapMap是一个接口,实现它的类不能包含重复的key,这一点和hashtable 很相似。 Map is an interface, classes that implement it cannot contain duplicate keys, and it is similar to a hashtable . Hashtable 和HashMap的一个关键性的不同是,HashTable 是同步的,而HashMap不是。The difference between Hashtable and HashMap is: Hashtable is synchronized, HashMap is not. Java1.0和1.1中两个主要的集合类是Vector和Hashtable ,迭代器是通过一个叫做枚举的类实现的。 In Java 1.0 and 1.1, the two primary collection classes were Vector and Hashtable , and the Iterator design pattern was implemented in a class called Enumeration. Hashtable 和HashMap的一个关键性的不同是,HashTable 是同步的,而HashMap不是。The only difference between the HashTable and HashMap is that Hashtable is synchronized whereas HashMap is not. HashCode的通用约定,从而导致该类无法和基于散列的集合(HashMap、HashSet和Hashtable )一起工作。 HashCode(), which will prevent your class from functioning properly in conjunction with all hash-based collections, including HashMap, HashSet, and Hashtable . Hashtable 和HashMap的一个关键性的不同是,HashTable 是同步的,而HashMap不是。The basic difference between a Hashtable and an HashMap is that, Hashtable is synchronized while HashMap is not. HashCode的通用约定,从而导致该类无法结合所有基于散列的集合一起正常运作,这样的集合包括HashMap、HashSet和Hashtable 。 HashCode(), which will prevent your class from functioning properly in conjunction with all hash-based collections, including HashMap, HashSet, and Hashtable . Hashtable 和HashMap的一个关键性的不同是,HashTable 是同步的,而HashMap不是。There is one more difference between HashMap and Hashtable that is Hashtable is synchronized while HashMap is not. Hashtable 的262,234个实例中,有127,016(48.4%)的实例完全未空,几乎所有实例都仅包含少量条目。Hashtable , 127,016(48.4 percent) of them are completely empty, and that almost all of them only have a small number of entries. Hashtable 和HashMap的一个关键性的不同是,HashTable 是同步的,而HashMap不是。One of the major differences between HashMap and Hashtable is that HashMap is non-synchronized whereas Hashtable is synchronized.
Display more examples
Results: 27 ,
Time: 0.0171