public class ExceptionDemo1{
    public static void main(String[] argv){
        try{
            int i = -1;
            String s = "lalala";
            
            System.out.println(s.charAt(i));
        }
        catch(Throwable e){	    
            if (e instanceof StringIndexOutOfBoundException){
                //...
            }
            else if (e instanceof NullPointerException){
                //...
            }
            
            for(int k=0;k<10;k++)
                System.out.println("Sorry I made an Exception " + e);
        }
    }
}

