What are the replacements for legacy collections `Stack` and `Properties`?

What are the replacements for legacy collections Stack and Properties , given that they may probably have synchronized methods (at least those inherited from Vector and Hashtable respectively)?

See my comment here Why is Java Vector class considered obsolete or deprecated?

Thanks.


Directly from the Stack JavaDocs:

A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class. For example:

Deque<Integer> stack = new ArrayDeque<Integer>();
链接地址: http://www.djcxy.com/p/13290.html

上一篇: 如何避免检查方法链中的空值?

下一篇: 什么是遗留集合`Stack`和`Properties`的替代品?