• 22 December


    java.util.NoSuchElementException is a RuntimeException or say an UncheckedException and therefore it does not need to be declared in a constructor’s or a method’s throw block. java.util.NoSuchElementException is usually thrown when we try to access some element which is not present or reserved for the underlying data structure in the heap, and, thrown by the different […]

  • 21 December


    In this article, we will discuss about the java.lang.StackOverflowError by looking different code examples and also how can we avoid them. More precisely, 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 errors one can encounter, because it’s raising […]

  • 09 May

    FileNotFoundException in Java

    In this post, we will see about FileNotFoundException in java. FileNotFoundException is thrown by constructors of FileInputStream, FileOutputStream, RandomAccessFile when file is not found on specified path. Exception can also be raised when file is inaccessible for some reason.For example: When you do not have proper permissions to read the files. FileNotFoundException is checked exception […]

  • 05 October


    In this post, we will see about Java.lang.NumberFormatException. java.lang.NumberFormatException occurs where you try to convert any non-numeric String to Number such as Integer, Double, Float or Long. This exception generally occurs when you get input from user in the form of String. This is not Java developer‘s fault and mostly data error. In this scenario, […]

  • 06 April

    [Solved] Exception in thread “main” java.lang.NullPointerException

    In this tutorial, we will see the most frequent java exception i.e. Exception in thread main java.lang.NullPointerException. It is one of the Runtime Exception. Raise your hand if you ever got NullPointerException while working on java code. I am sure that this is the exception you might have encountered most frequently. You might also agree […]