• Finally : 1 step to handle all errors

    In all advance level exception handling, all programmer use finally keyword to prevent run time error. Let’s take one example: User-1 transfers amount to another User-2 account. Amount withdraws from User-1 and suddenly some hardware or networking error generated. That time finally block removes all transfer amounts.   Example on Finally in exception handling class […]

    Share and Enjoy

    • Facebook
    • Twitter
    • Delicious
    • LinkedIn
    • StumbleUpon
    • Add to favorites
    • Email
    • RSS
  • IOException with BufferedReader class

    IOException is on run time input output exception handler, when we use java.io.* package’s classes that time we have to use IOException for handling error. BufferedReader is one inbuilt class. BufferedReader class must be in java.io.* package so we have to import that package in our program starting. In this program, we will see how […]

    Share and Enjoy

    • Facebook
    • Twitter
    • Delicious
    • LinkedIn
    • StumbleUpon
    • Add to favorites
    • Email
    • RSS
  • IllegalAccessException with throws

    In this blog, we will work on IllegalAccessException using throws keywords. This example is same as NullPointerException using throw keyword. Using this example we can understand basic different between throws and throw.   Example on IllegalAccessException class A {             void setMethod1() throws IllegalAccessException             {                                   // No need to try and catch block […]

    Share and Enjoy

    • Facebook
    • Twitter
    • Delicious
    • LinkedIn
    • StumbleUpon
    • Add to favorites
    • Email
    • RSS
  • Custom Exceptions using throw keyword

    Maximum MNC company create own structure code. In this structure code they also create Custom Exceptions handling classes, methods and constructors. In this blog example, we create LoginException exception for check login details of admin panel.   LoginException : Custom Exceptions import java.util.*;                   class LoginException extends Exception {             LoginException(String errorMessage)             {                         super(errorMessage);           […]

    Share and Enjoy

    • Facebook
    • Twitter
    • Delicious
    • LinkedIn
    • StumbleUpon
    • Add to favorites
    • Email
    • RSS
  • NullPointerException – Handle by throw

    NullPointerException is run time error, when we display object and do not find any value in object. In this blog, we will see how this exception handles by throw keyword.   This example and video work on throw keyword. class A {             void method1()             {                         try                         {                                     //throw new NullPointerException(“Error […]

    Share and Enjoy

    • Facebook
    • Twitter
    • Delicious
    • LinkedIn
    • StumbleUpon
    • Add to favorites
    • Email
    • RSS