A
arjunkumar
Newbie
I'm trying to define my own exception class the easiest way, and this is what I'm getting:
This is what Java compiler says from here.
I had a feeling that this constructor has to be inherited from java.lang.Exception, isn't it?
public class MyException extends Exception {}
public class Foo {
public bar() throws MyException {
throw new MyException("try again please");
}
}
This is what Java compiler says from here.
cannot find symbol: constructor MyException(java.lang.String)
I had a feeling that this constructor has to be inherited from java.lang.Exception, isn't it?
- Operating System
- Mac OS