Category Core Java interview Questions

Create a user defined exception in java

Java Custom Exceptions Program to create a user defined exception class Myexception extends Exception {             int detail;             Myexception(int a)             {                         detail=a;             }             public String toString()             {                         return “Myexception[“+detail+”]”;             } } class…

Enable Notifications OK No thanks