Exceptions Meaning Tutorial

Exceptions Meaning Tutorial

Exception handling makes a language robust. This Exceptions Tutorial for Beginners explains concepts in Simple terms Examples Screenshots. Go on reading.

The programmer faces two types of problems in coding – problems arising at compile-time and problems arising at runtime. Regarding compile-time problems or mistakes the compiler takes care of and ultimately does not compile the program. Generally, a novice, first time learning a programming language, thinks if his program is complied successfully, the output is guaranteed. He is not aware of that at runtime also problems may arise that may stop the program execution abruptly. The problems that arise at runtime are known as "exceptions". Simply, exceptions can be defined as runtime errors.

With this basic understanding, let us go still deeper in Exceptions Meaning.


Exceptions Tutorial

Mostly, the exceptions are caused by the user’s wrong interaction with a running program; feeding wrong input values at runtime which the system is unable to interpret and execute. If the system (Java Runtime Environment) is unable to determine what to do, it simply terminates the execution. An exception, as you understand by its literal meaning, does not arise every time; arises occasionally. It is an unexpected situation caused with the user’s incorrect input to the program.

If an exception arises, the JRE does not handle it implicitly. If not handled and not informed to the user what happened, he will be in a big confusion and thinks that software is not working properly now and then. The process of informing the user what happened and to see the program executes to the last statement, even if exception arises, is known as exception handling. Java comes with a robust exception handling mechanism, a feature of modern languages.

After understanding what exceptions are in this Exceptions Tutorial, go to the first program on exceptions.

17 thoughts on “Exceptions Meaning Tutorial

  1. Pinki Jain

    Sir,

    THis is one of the best site where the information provided is so relevant and so easy to learn. A boon for the beginners……
    Thank You so much

    1. Rama Krishna

      How catch block handle the Exception, please will you explain below code

      try{
      Class.forName(” “);
      }
      catch(ClassNotFoundException e)
      {
      e.printStackTrace();
      }

      above program ‘e’ is a variable type of a ClassNotFoundException class but how it handle the exception, how we are call methods by using variables. what happens there?

  2. Deepak Negi

    Respected Sir

    Recently I completed PG-DAC from CDAC. Now I want to choose between

    SPRING AND EJB (with HIBERNATE)

    Please tell the most demanding framework among the two ie SPRING AND HIBERNATE.

    I am comfortable in HIBERNATE (the BIGG REASON IS this website of yours. Having VERY EASY MATERIAL FOR THE BEGINNERS…. )

    REGARDS

    Dn

Leave a Reply

Your email address will not be published. Required fields are marked *