Created
March 10, 2012 13:57
-
-
Save paul-ihnatolia/2011483 to your computer and use it in GitHub Desktop.
Driver for Stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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