transparent
public Object pop() throws EmptyStackException{ Object obj; if (size == 0){ throw new EmptyStackException(); obj=objectAt(size--); return obj; }
transparent
class Trouve extends Exception{} class Mauvais { int t[]={ 1, 2, 3, 4, 5}; public void chercher(int v) throws Trouve{ for(int i=0; i<t.length;i++) if (t[i]==v) throw new Trouve(); } }
class main{ public static void main(String[] st){ Mauvais m=new Mauvais(); try{ m.chercher(4); } catch (Trouve e){ System.out.println("trouvé!"); } System.out.println("pas trouvé!") } }