If you are working with the File APIs in Java, it is common that you would encounter the FileNotFoundException. This is a subclass of IOException. This Java exception is thrown by the classes FileInputStream, FileOutputStream, and RandomAccessFile. These classes trying to access a file in the system for the purposes of reading or writing into …
Java Exceptions
NullPointerException in Java
One of the most common and nightmare for the Java programmers are getting the NullPointerException while running the Java application. This exception is defined at the “java.lang” package and the purpose of the exception is to detect if an object is used without any content. Here you must understand the difference between Reference and Object. …
java.util.ConcurrentModificationException
ConcurrentModificationException is thrown when two threads are updating the same element on same time. This issue occurs often in the multithreaded environment. However, this also can occur in the single thread environment where same application running the multiple threads which updates the same object. Look at this example which throws ConcurrentModificationException while updating the value …