Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. import java.util.Stack;
  2.  
  3. public class Other
  4. {  
  5.     public static void main(String [] args) {
  6.         Stack<String> s = new Stack();
  7.        
  8.         s.push("one");
  9.         s.push("two");
  10.         s.push("three");
  11.         s.push("four");
  12.        
  13.         while(!s.isEmpty()) {
  14.             System.out.println(s.pop());
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement