import java.io.IOException;
public class JavaExceptionExample {
void numcheck(int num) throws IOException,ClassNotFoundException{
if (num == 1)
{
throw new IOException ("IOException");
}
else
{
throw new ClassNotFoundException ("Class Not Found");
}
}
public static void main(String args []) {
JavaExceptionExample obj=new JavaExceptionExample();
try
{
obj.numcheck (2);
}
catch(Exception e)
{
System.out.println(e);
}
}
}