Java Program to Handle ClassNotFoundException

Java Program to Handle ClassNotFoundException

Java Program to Handle ClassNotFoundException

// Java program to handle ClassNotFoundException

public class Main {
  public static void main(String[] args) {
    try {
      Class.forName("Codingdiksha");
    } catch (ClassNotFoundException a) {
      System.out.println("Exception: " + a);
    }

    System.out.println("Program Finished");
  }
}
Exception: java.lang.ClassNotFoundException: Codingdiksha
Program Finished

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment