programming-examples/java/Servlets_Session_Swing_Util/Stack Demo.java

23 lines
458 B
Java
Raw Normal View History

2019-11-15 12:59:38 +01:00
Stack Demo
import java.util.Stack;
public class StackDemo
{
public static void main(String args[])
{
Stack lifo=new Stack();
for(int i=1; i<=20; i++)
{
lifo.push (new Integer(i) );
}
while(!lifo.empty())
{
System.out.print(lifo.pop());
System.out.print(',');
}
System.out.println("LIFT-OFF");
}
}