Last active
November 22, 2016 11:18
-
-
Save AJLoveChina/01474c06b3ba461afd060e2f59762a03 to your computer and use it in GitHub Desktop.
Difference Between ClassNotFoundException Vs NoClassDefFoundError In Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Java, both ClassNotFoundException and NoClassDefFoundError occur when a particular class is not found at run time. | |
But, they occur at different scenarios. ClassNotFoundException is an exception which occurs when you try to load a class | |
at run time using Class.forName() or loadClass() methods and mentioned classes are not found in the classpath. | |
On the other hand, NoClassDefFoundError is an error which occurs when a particular class is present at compile time | |
but it was missing at run time. In this tutorial, we will see the differences between ClassNotFoundException Vs NoClassDefFoundError | |
in java and when they occur. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment