Results 1 to 4 of 4
Thread: Interview Question
- 08-25-2010, 10:37 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 6
- Rep Power
- 0
- 08-25-2010, 11:09 AM #2
NoClassDefFoundException - The Java runtime can't find the class file, that's because classpath isn't set properly.
ClassNotFoundException -Thrown when an application tries to load a class through its string name using Class.forName, ClassLoader. findSystemClass or ClassLoader. loadClass
- for more start googling
-Regards
- 08-25-2010, 11:15 AM #3
Member
- Join Date
- Aug 2010
- Posts
- 11
- Rep Power
- 0
Hi Bunny,
Both are almost same Exceptions.The difference is
If you use
Car c=new Car(); statement in your program,then this class will statically(compiletime) load.In this case,if the runtime system cannot find the referenced class then "NoClassDefFoundException" will be thrown.
If you use
Class.forName ("Car"); statement in your program,then this class will dynamically(runtime) load.In this case,if the runtime system cannot find the referenced class then "ClassNotFoundException" will be thrown.
- 08-25-2010, 11:28 AM #4
Member
- Join Date
- Aug 2010
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
An Interview Question.
By vinoth in forum New To JavaReplies: 7Last Post: 04-01-2010, 11:02 AM -
help for java interview
By javastuden in forum New To JavaReplies: 2Last Post: 03-09-2010, 09:24 AM -
Java Interview Question and Answer
By gnomeom in forum Java SoftwareReplies: 3Last Post: 06-04-2009, 11:53 AM -
Java Threads Interview Question
By _tony in forum Threads and SynchronizationReplies: 20Last Post: 12-22-2008, 08:31 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks