/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jeccezioni; /** * * @author gabriele */ import java.util.*; /** * Programma principale per Pila * @author gabriele */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Pila p= new Pila(); for(int i=0; i<10; i++){ p.push(i); } try{ for(int i=0; i<11; i++) { //troppi pop!! System.out.println(p.top()); p.pop(); } } catch(EmptyStackException e){ System.out.println("ERRORE: Pila vuota!"); } } }