Java

Topic: Exceptions

What is difference between ClassNotFoundException and NoClassDefFoundError?

A ClassNotFoundException is thrown when the reported class is not found by the ClassLoader in the CLASSPATH. It could also mean that the class in question is trying to be loaded from another class which was loaded in a parent classloader and hence the class from the child classloader is not visible.

Consider if NoClassDefFoundError occurs which is something like java.lang.NoClassDefFoundError

Browse random answers: