Answers for "what is an exception and how do we handle exceptions 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 "what is an exception and how do we handle exceptions in java?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language