I did not see this in the objectives for the exam.
I ran across a post on this forum from 2002 about it.
What will the following program print when run?
I'm using K&B SCJP 6 and didn't see any mention of it.
btw the answer is:
Write code that uses the generic versions of the Collections API, in particular, the Set, List, and Map interfaces and implementation classes.
Stack class itself is actually simple if you know about the interfaces that it implements and if you know the general working of stacks i.e. last in first out (LIFO)...
This question is not really about Stacks though You should be able to answer it even if you know nothing about the Stack class.
I did not know what behavior push() has on a Stack object or if the object and method were just made up. I was not able to know if it is going to affect the reference passed in as an argument or not and how. I did not know what Stack.toString() method would return.
I just learned the hard way that Stack and push() exist and what they do.
It's good to know though.