News

Unchecked Exception requires no work from the programmer. The compiler takes care of the issue. For example, nullpointer exception, divide by zero exception, etc. are examples of unchecked exceptions.
An example of a checked exception is java.io.IOException. As the name suggests, it throws whenever an input/output operation is abnormally terminated. Examine the following code: ...
Exception handling - try, catch, finally blocks, Throw exceptions, Creating custom exception class, chained exceptions, Advantages of exceptions. Basic I/O - I/O Streams using java.io package (Byte, ...
How to use Java’s var keyword Packaged as part of the 2018 version 10 release, the Java var reserved word introduced type inference to the strongly typed Java programming language. Type inference in ...
throw = To hand-over our created Exception Object to the JVM manually throws = To delegate the responsibility of Exception Handling to the caller method (that can be caller method). Sometimes, to meet ...
Fix these 10 common examples of the RuntimeException in Java. Don't let the occurrence of a RuntimeException in Java bring your code to a standstill. Here are 10 examples of how to avoid runtime ...
Some other good features of Java exception handling are checked exceptions, user-defined exceptions, and the new Java logging API coming out in JDK 1.4. Every subclass of java.lang.Exception is a ...
A good example would be the FileNotFoundException.This does exactly what it says on the tin: this exception is “thrown” when Java looks for a particular file and can’t find it.