Answers for "how exception handling is implemented using try and catch in java"

2

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...");  
  }  
}
Posted by: Guest on February-07-2022

Code answers related to "how exception handling is implemented using try and catch in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language