Here's the first exception coding I've ever done and guess what, it's generating an error. Sad.
public class Exc {
int x = 2;
public void throwE(int p) throws Excp {
if(x==p) {
throw new Excp();
}
}
}
I don't think I need to post the handler code as even this class isn't getting through compiler.
I'm getting the error cannot find symbol
at Excp
. I'm doing exactly according book. Is there something I'm missing?