Another Java class that can hold many values is Stack. Stacks only allow you to add a new element (push) or retrieve the most recently added element (pop). This type of data structure is known as "last-in, first-out" or "LIFO".
Stack<String> namesStack = new Stack();
namesStack.push("Sarah");
namesStack.push("Ali");
namesStack.push("Joe");
String lastName = namesStack.pop(); //lastName will have the value "Joe"
Things to find out before you finish this module:
StackDemo
IntroToStack
TextUndoRedo