Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
~ Mansukh
priyanaka jaiswal wrote:NoClassDefFoundError- is thrown at runtime when classloader not find that partciular class or jar in classpath.
The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.
priyanaka jaiswal wrote:ClassNotFoundException is thrown when classloader not find that particular class or jar at compile -time
am i correct? anything i am missing ....
~ Mansukh
Mansukhdeep Thind wrote:One is an exception and the other an error. HUGE difference.
Mansukhdeep Thind wrote:
Yes, it is a compile time or a checked exception. Class names are resolved during compile time and if a class by that name is not found, it throws this exception.
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:One is an exception and the other an error. HUGE difference.
That doesn't even remotely answer the question.
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:And note that both are exceptions, but only one is an Exception.
~ Mansukh
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:
Yes, it is a compile time or a checked exception. Class names are resolved during compile time and if a class by that name is not found, it throws this exception.
No.
1. There's no such thing as a "compile-time" exception.
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:2. All exceptions that your code may have to deal with are thrown at runtime, never at compile-time. Including ClassNotFoundException.
~ Mansukh
OCPJP
Mansukhdeep Thind wrote:
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:One is an exception and the other an error. HUGE difference.
That doesn't even remotely answer the question.
If I had answered straightaway, the OP wouldn't have remembered what it is.
Ishan Pandya wrote:I am not at all sure but the basic difference is - ClassNotFoundException is fired when a Java Class is not found by the compiler and NoClassDefFoundError checks about the Class file. is it?? please comment and correct.
Thanks.
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:
Jeff Verdegan wrote:
Mansukhdeep Thind wrote:One is an exception and the other an error. HUGE difference.
That doesn't even remotely answer the question.
If I had answered straightaway, the OP wouldn't have remembered what it is.
That doesn't mean you should post something totally useless. There's a difference bewteen "not giving them a full answer" and "giving them nothing at all."
~ Mansukh
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |