This is kind of a Java trivia question perhaps.
I have used the Stack implementation many times.
I have read that this is considered a legacy class and due to the fact that it subclasses Vector makes its performance bad in single threaded applications.
My question is, what is the best alternative among the Java Collection classes?
Is there another Stack class available (by a different name perhaps) that is the one to choose?
I mean, ok implementing a stack arround another existing data structure is easy, but I would expect there is an existing Stack to use.
If you read a more current Javadoc (1.6 or 1.7 for example) rather than the old 1.4.2 docs, you’ll find:
http://docs.oracle.com/javase/6/docs/api/java/util/Stack.html
http://docs.oracle.com/javase/7/docs/api/java/util/Stack.html