Exception, Exception Handling
java
dev.to
Exception An exception in Java is an unwanted or unexpected event that occurs during the execution of a program, which disrupts the normal flow of instructions.An exception is a runtime error that occurs while the program is running. Example int a = 10; int b = 0; System.out.println(a / b); --> This code will cause an exception: ArithmeticException (division by zero) Why Do Exceptions Occur? -> Dividing a number b