Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

exception handling in java

public class JavaExceptionExample{  
  public static void main(String args[]){  
   try{  
      //code that may raise exception  
      int data=100/0;  
   }catch(ArithmeticException e){System.out.println(e);}  
   //rest code of the program   
   System.out.println("rest of the code...");  
  }  
}  
 
PREVIOUS NEXT
Tagged: #exception #handling #java
ADD COMMENT
Topic
Name
3+8 =