All About Class ClassNotFoundException in Java



ClassNotFoundException is thrown from a program when an application tries to load in a class through it's String name using any of the below methods:

  1. forName(), this method is defined in Class Class.
  2. findSystemClass(),this method is defined in Class ClassLoader.
  3. loadClass(),this method is defined in Class ClassLoader.
but no definition for the class with the specified name is found. The structure of the class is given below:

public class java.lang.ClassNotFoundException extends java.lang.Exception{
//constructor
public ClassNotFoundException ();
//constructs an empty ClassNotFoundException object that is an object with no message specified.
public ClassNotFoundException(String message);
//constructs an ClassNotFoundException object with the message specified.

}
 
All About Class ClassNotFoundException in Java All About Class ClassNotFoundException in Java Reviewed by Animesh Chatterjee on September 17, 2018 Rating: 5

No comments:

Powered by Blogger.