When JVM tries to load a class by its string name, and couldn’t able to find the class classNotFoundException will be thrown. So as per the Java doc classNotFoundException will thrown when an application tries to load in a class through its string name using:
- The
forNamemethod in classClass. - The
findSystemClassmethod in classClassLoader. - The
loadClassmethod in classClassLoader.
Posted in: