import java.util.Stack;
public class StacksDemo
{
public static void main(String[] arguments)
{
Stack newStack = new Stack();
newStack.push("10");
newStack.push("20");
newStack.push("30");
newStack.push("40");
// and many more items to push
while(!newStack.empty())
{
System.out.println(newStack.pop());
}
}
}