can someone tell me why am i getting "cannot find symbol" while compiling.
This is how i define my own exception:
public void setIdNumber(int i)throws InvalidEmployeeId
{
idNumber = i;
if ((idNumber <= 0))
{
throw new InvalidEmployeeId("invalid ID. Please input numeric ID");
}
}
cannot find symbol:
public void setIdNumber(int i)throws InvalidEmployeeId
symbol: class InvalidEmployeeId
Here is the try and catch statement in the demo program:
try
{
id = Integer.parseInt(input);
worker.setIdNumber(id);
} catch (invalidEmployeeId e)
{
System.out.println(e.getMessage());
}
thanks in advance;