Tag Archives: Java-Exceptions

An unwanted unexpected event that disturbs the normal execution of the program after getting compiled while running is called an exception. In order to deal… Read More
The java.lang.ClassCastException is one of the unchecked exception in Java. It can occur in our program when we tried to convert an object of one class type into… Read More
java.io.FileNotFoundException which is a common exception which occurs while we try to access a file. FileNotFoundExcetion is thrown by constructors RandomAccessFile, FileInputStream, and FileOutputStream. FileNotFoundException… Read More
IOException is a type of checked exception which occurs during input/output operation. BufferedReader is used to read data from a file, input stream, database, etc.… Read More
StackOverflowError is an error which Java doesn’t allow to catch, for instance, stack running out of space, as it’s one of the most common runtime… Read More
In this article, the enhancements made by Oracle in version 1.7, along with its implementation, has been discussed. As a part of 1.7 version enhancement,… Read More
ConcurrentModificationException in Multi threaded environment In multi threaded environment, if during the detection of the resource, any method finds that there is a concurrent modification… Read More
In order to learn how to avoid an error, we must first understand the error. NullPointerException NullPointerException is a RuntimeException. In Java, a special null… Read More
Prerequisite: Exception and Exception Handling in Java, Overriding in Java, Checked and Unchecked Exception. An Exception is an unwanted or unexpected event, which occurs during… Read More
What is an Exception? An exception is an “unwanted or unexpected event”, which occurs during the execution of the program i.e, at run-time, that disrupts… Read More
Getting name of currently executing method is useful for handling exceptions and debugging purposes. Below are different methods to get currently executing method : Using… Read More
The addSuppressed?(Throwable exception) method of a Throwable class used to append the exception to the exceptions that were suppressed in order to deliver this exception.… Read More
The setStackTrace(StackTraceElement[] stackTrace) method of Throwable class is used to Set the stack trace elements to this throwable object and this stack trace will be… Read More
The toString() method of Java.lang.Throwable class used to return a String representation of this Throwable which consists of the name of the class of this… Read More
printStackTrace() The printStackTrace() method of Java.lang.Throwable class used to print this Throwable along with other details like class name and line number where the exception… Read More