Why are Vector and HashTable widely believed to be due for deprecation? [duplicate]
Possible Duplicate:
Why Java Vector class is considered obsolete or deprecated?
Also, is there an official word from Sun/Oracle on that?
Thanks.
EDI开发者_运维知识库T: I'm aware of the other topic, but it didn't mention whether there was an official word on this, which is why the topic is worded as "widely believed". Plus, that topic addresses only the Vector, not the Hashtable.
Vector
is synchronized; usually you don't need this as it incurs serious overhead.
Hashtable
is also synchronized and can't reasonably store null
s.
People use various Lists and HashMap
instead.
精彩评论