Arithmetic exception

 public class ExceptionExample {

 public static void main(String[] args) {

 try {

 int a = 10 / 0;

 } catch (ArithmeticException e) {

 System.out.println("Arithmetic Exception occurred: " + e.getMessage());

 }

 }

}


Comments

Popular posts from this blog

10. Vehicle and Car

Interface with Rectangle

Multiple interface