Code:
public class ThrowTest{
 public static void main(String[] args){

 try {
  int i = 7 / 0; 

  }catch(Exception e){
    System.out.println(e.getClass().getName());
    System.out.println(e.getMessage());
  }
 }
}
or
Code:
public class ThrowTest{
  public static void main(String[] args){

    try {
      int i = 7 / 0; 
    } catch(ArithmeticException e) {
      System.out.println("ArithmeticException");
      System.out.println(e.getMessage());
    } catch(ClassCastException e) {
      System.out.println("ClassCastException");
    } // ...
  }
}
The main difference to yours is that mine doesn't run the hierarchy. In your example your code would print:
ArithmeticException
Integer division by zero
RuntimeException
Integer division by zero
Exception
Integer division by zero
Throwable
Integer division by zero
while mine would only print
ArithmeticException (or java.lang.ArithmeticException)
Integer division by zero