What is difference between classnotfoundexception and noclassdeffounderror?



What is difference between classnotfoundexception and noclassdeffounderror?..

Answer / 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

More Spring Framework Interview Questions

Which is better spring jpa or hibernate?

1 Answers  


How many ways can you set up spring?

1 Answers  


What is the life cycle of a bean in spring?

1 Answers  


What is difference between bytype and byname in spring?

1 Answers  


what is default scope in spring?

1 Answers  


Is liferay a cms?

1 Answers  


Is it allowed to use multiple spring configuration files in spring mvc?

1 Answers  


Does spring boot require web xml? : Spring Boot

1 Answers  


Does spring boot use tomcat? : Spring Boot

1 Answers  


What are the different modules used in spring?

1 Answers  


What do you mean by aspect oriented programming (aop)?

1 Answers  


What is circular dependency in spring?

1 Answers  


Categories