adspace
What is difference between classnotfoundexception and noclassdeffounderror?
Answer Posted / Shishir Tiwari
Both ClassNotFoundException and NoClassDefFoundError are subclasses of the Exception class in Java, but they occur under different circumstances. ClassNotFoundException is thrown when the JVM or class loader attempts to load a class by its name and fails because the class cannot be found as a system resource or in the bootstrap class path. On the other hand, NoClassDefFoundError is thrown when the Java Virtual Machine or the linker tries to link a class (either during the initialization of a class or while resolving a method or field reference) and cannot find the class in the compile-time classpath.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers