1 try
2 {
3 int a = 20/0;
4 } catch (Exception e)
5 {
6 // getMessage method
7 // Prints only the message of exception
8 // and not the name of exception
9 System.out.println(e.getMessage());
10
11 // Prints what exception has been thrown
12 System.out.println(e);
13 }