Home » Tag Archives: Exceptions

Tag Archives: Exceptions

Java Exception Handling Tutorial with Examples and Best Practices

java-logo

Exception is an error event that can happen during the execution of a program and disrupts its normal flow. Java provides a robust and object oriented way to handle exception scenarios, known as Java Exception Handling. We will look into following topics in this tutorial.               Java Exception Handling Overview Exception Handling Keywords Exception ...

Read More »

java.lang.ClassNotFoundException: How to resolve

java-logo

This article is intended for Java beginners currently facing java.lang.ClassNotFoundException challenges. It will provide you with an overview of this common Java exception, a sample Java program to support your learning process and resolution strategies. If you are interested on more advanced class loader related problems, I recommended that you review my article series on java.lang.NoClassDefFoundError since these Java exceptions ...

Read More »

Exception: java lang AbstractMethodError

java-logo

This java.lang.AbstractMethodError is usually thrown when we try to invoke the abstract method.Generally this error is identified at the compile time itself,if this error is thrown at run-time then the class must be incompatibly(not compatible with preexisting classes) changed.Hence it is a sub class of IncompatibleClassChange Error. We know that an abstract method cannot be invoked and if we try ...

Read More »

Java Exception: java lang NoSuchMethodError

java-logo

If you have a look at the error message java.lang.NoSuchMethodError you may understand that the Java Virtual Machine is trying to indicate us that the method you invoked is not available in the class or in an interface. You could have also seen this error thrown when executing a class that has no public static void main() method.To know the ...

Read More »

Exception Handling Guidelines & Best Practices

java-logo

Let’s review some basic exception design guidelines, summarized from Object Design: Roles, Responsibilities, and Collaborations (Rebecca Wirfs-Brock and Alan McKean, Addison-Wesley, 2003). Don’t try to handle coding errors. Unless your software is required to take extraordinary measures in error scenarios, don’t spend a lot of time designing it to detect and recover from programming errors. In the case of an ...

Read More »

Java 7’s Support for Suppressed Exceptions

java-logo

A new constructor and two new methods were added to the Throwable class (parent of Exception and Error classes) in JDK 7. The new constructor and two new methods were added to support “suppressed exceptions” (not to be confused with the bad practice of swallowing or ignoring exceptions). In this post, I look at why these methods were introduced and ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.