Stack Class
      Stack class is available in java. Stack is used which means that we have to define the type of E like integer,string etc and the stack will be intialised with the type of E only.
/*
	http://www.ProbCOMP.com	
	
	Stack class is available in java. Stack<E> is used which means that we have to 
	define the type of E like integer,string etc and the stack will be intialised with the type
	of E only.

*/

import java.util.*;

public class UsingStack{
	public static void main(String args[])
	{
		Stack<String> stack = new Stack<String>();
		stack.push("hello");
		stack.push("world");
		while(!stack.empty())
		{
			System.out.println(stack.pop());
		}
	}
}									

Download Program
Did You Know ?
IP address is a numerical label that is assigned to devices participating in a computer network. Read More