Wednesday, April 3, 2019

Hibernate interview questions part-2

1. What is a class and object in Java?
2. What does instance mean?
3. What is difference between instance and object?
4 . What is System.Out.Println in java ?
5. What is the difference between ClassNotFoundException Vs NoClassDefFoundError ?
  • ClassNotFoundException : ClassNotFoundException is an exceptin. This exception comes when application tries to load a class at runtime by using Class.forName() or loadClass() methods and class are not present in the classpath.
  • NoClassDefFoundError : NoClassDefFoundError is an error. This error comes while a class present at compile time but not present at runtime
How to resolve this issue ?
  • As java.lang.NoClassDefFoundError is a runtime error due to class not present in classpath. So add the particular class at classpath.



No comments:

Post a Comment