mirror of
https://github.com/github/semantic.git
synced 2024-12-20 13:21:59 +03:00
20 lines
569 B
Java
20 lines
569 B
Java
class Example2{
|
|
public static void main(String args[]){
|
|
try{
|
|
int a[]=new int[7];
|
|
a[4]=30/0;
|
|
System.out.println("First print statement in try block");
|
|
}
|
|
catch(ArithmeticException e){
|
|
System.out.println("Warning: ArithmeticException");
|
|
}
|
|
catch(ArrayIndexOutOfBoundsException e){
|
|
System.out.println("Warning: ArrayIndexOutOfBoundsException");
|
|
}
|
|
catch(Exception e){
|
|
System.out.println("Warning: Some Other exception");
|
|
}
|
|
System.out.println("Out of try-catch block...");
|
|
}
|
|
}
|