Skip to main content

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTableHashtable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between HashTableHashtable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTableHashtable is part of Java's legacy code, you'll see that the HashTableHashtable API is enhanced to implement the MapMap interface, to become part of Java's collections framework. This means that if you were to wrap HashTableHashtable through Collections.synchronizedMap(), the API of the wrapped HashTableHashtable would become limited to the MapMap API. So if the API of HashTableHashtable is encompassed in your definition of behavior, then it is obviously altered/limited.

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between HashTable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTable is part of Java's legacy code, you'll see that the HashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. This means that if you were to wrap HashTable through Collections.synchronizedMap(), the API of the wrapped HashTable would become limited to the Map API. So if the API of HashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap Hashtable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between Hashtable and Collections.synchronizedMap(HashMap) exist more at the API level. Because Hashtable is part of Java's legacy code, you'll see that the Hashtable API is enhanced to implement the Map interface, to become part of Java's collections framework. This means that if you were to wrap Hashtable through Collections.synchronizedMap(), the API of the wrapped Hashtable would become limited to the Map API. So if the API of Hashtable is encompassed in your definition of behavior, then it is obviously altered/limited.

edited answer for better readability
Source Link
Kushal
  • 8.5k
  • 10
  • 66
  • 83

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTableHashTable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between HashTableHashTable and Collections.synchronizedMap(HashMap)Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTableHashTable is part of Java's legacy code, you'll see that the HashTableHashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. This means that if you were to wrap HashTableHashTable through Collections.synchronizedMap()Collections.synchronizedMap(), the API of the wrapped HashTableHashTable would become limited to the Map API. So if the API of HashTableHashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between HashTable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTable is part of Java's legacy code, you'll see that the HashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. This means that if you were to wrap HashTable through Collections.synchronizedMap(), the API of the wrapped HashTable would become limited to the Map API. So if the API of HashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between HashTable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTable is part of Java's legacy code, you'll see that the HashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. This means that if you were to wrap HashTable through Collections.synchronizedMap(), the API of the wrapped HashTable would become limited to the Map API. So if the API of HashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

deleted 9 characters in body
Source Link
Nadir Muzaffar
  • 4.9k
  • 2
  • 34
  • 48

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTable through Collections.synchronized, you would have the same degree of synchronization, but with aanother redundant layer, of synchronization.

  2. The main difference between HashTable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTable is part of Java's legacy code, you'll see that the HashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. So, which means, HashTable has an extended API. This impliesmeans that if you were to wrap HashTable through Collections.synchronizedMap(), the API of the wrapped HashTable would become limited to the Map API. So if the API of HashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTable through Collections.synchronized, you would have the same degree of synchronization, with a redundant layer of synchronization.

  2. The main difference between HashTable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTable is part of Java's legacy code, you'll see that the HashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. So, which means, HashTable has an extended API. This implies that if you were to wrap HashTable through Collections.synchronizedMap(), the API of the wrapped HashTable would become limited to the Map API. So if the API of HashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

Here are the answers I've gotten from a bit of (hopefully correct) research:

  1. Both provide the same degree of synchronization. If you were to wrap HashTable through Collections.synchronized you would have the same degree, but with another redundant layer, of synchronization.

  2. The main difference between HashTable and Collections.synchronizedMap(HashMap) exist more at the API level. Because HashTable is part of Java's legacy code, you'll see that the HashTable API is enhanced to implement the Map interface, to become part of Java's collections framework. This means that if you were to wrap HashTable through Collections.synchronizedMap(), the API of the wrapped HashTable would become limited to the Map API. So if the API of HashTable is encompassed in your definition of behavior, then it is obviously altered/limited.

fixed grammar, corrected for formated
Source Link
Loading
Source Link
Nadir Muzaffar
  • 4.9k
  • 2
  • 34
  • 48
Loading