i have code such as:
MyException.java
package except;
public class MyException extends Exception
{
private
String msg;
public MyException()
{
this.msg="Maths Wrong";
}
}
ExceptionThrow.java
package except;
public class ExceptionThrow
{
public static void main(String args[])
{
num(10);
num(0);
}
static void num(int x) throws MyException
{
if(x==0) throw new MyException();
}
}
I am not able to compile ExceptionThrow.java