Skip to content

Instantly share code, notes, and snippets.

@paul-ihnatolia
Created March 10, 2012 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paul-ihnatolia/2011483 to your computer and use it in GitHub Desktop.
Save paul-ihnatolia/2011483 to your computer and use it in GitHub Desktop.
Driver for Stack
package org.uzhnu.homework.stack;
public class Driver {
/**
* @param args
*/
public static void main(String[] args) {
// init empty stack
Stack st = new Stack();
//init stack with array
String [] mas = new String[]{"One","Two","Three"};
Stack st2 = new Stack(mas);
try{
System.out.println("removed element: " + st2.pop());
st2.push("One");
st2.push("One");
st2.push("One");
st.pop();
}catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment