Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DemoStack1 {
- public static void main(String[] args) {
- System.out.println("Demo de Stack");
- Stack miPila = new Stack();
- miPila.push('a');
- miPila.push('b');
- miPila.push('c');
- System.out.println(miPila.pop());
- System.out.println(miPila.pop());
- System.out.println(miPila.pop());
- try {
- System.out.println(miPila.peek());
- } catch (Exception e){
- System.out.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement