1) class Stack: public E push(E item)
class Stack - its push method just returns its argument (unlike newer Deque, whose respective push method is now void):
public E push(E item)
Can you provide any useful real-life / production example of using this feature?
I understand that Stack is legacy, use Deque implementations instead.
But how this feature was used in legacy apps? I guess it could be used for call chaining, but can't think of a practical example.
2) Do you often have to work with Stack class in you everyday work? Is it widely still widely used? Or most legacy apps have already been refactored to use Deque?
3) Is there any practical benefit (and is it worth it) to refactor Stack to Deque, if I encounter Stack in any legacy app which I am actively developing (adding new features)? I understand that in new apps Deque is preferrable, but if I already have Stack in legacy app, from practical point of view are there cases when it is absolutely worth effort to refactor it to Deque?
4) Am I right, that if I need use stack datastructure in multithreaded access, I shall use ConcurrentLinkedDeque (because I shall prefer Deque implementations over Stack class)? Or is there any practice to use Stack for multithreaded access nowadays? I think no, but I'd still like to ask gurus.