Sep

09

class MyEx extends Exception{
MyEx(String s){
super(s);
//System.out.println(s);
}
}
class TestMyEx{
public static void main(String args[]){
int i=10;
if(i==10){
try{
throw new MyEx(“MY Exception is raised”);
}
catch(MyEx e){
System.out.println(e);
}
}
System.out.println(i);
}
}


Leave a Reply