Source Code : Stack in java.util
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Stack in java.util

import java.util.Stack;
public class StackExample {
public static void main(String args[]) {
Stack s = new Stack();
s.push("Java");
s.push("Source");
s.push("and");
System.out.println("Next: " + s.peek());
s.push("Support");
System.out.println(s.pop());
s.push(".");
int count = s.search("Java");
while (count != -1 && count > 1) {
s.pop();
count--;
}
System.out.println(s.pop());
System.out.println(s.empty());
}
}
Thank with us