You are here: Home / Topics / Default Exception Handler of JVM

Default Exception Handler of JVM

Filed under: Java on 2023-09-19 06:43:44

// Simple  Program without Exception Handling and 
// use of Default Handler of JVM.

class  DefaultException
{
public static void main(String args[ ]) 
{
 int  d = 0;
 int  a = 10 / d;
 // here JVM automatiically handle exaception
}
}


Output:

Exception in thread "main" java.lang.ArithmeticException
 at DefaultException.main(DefaultException.java:20)

About Author:
M
Mr. Dubey     View Profile
Founder and CEO of MCQ Buddy. I just like to help others.