I've been investigating Java's ParseException, when trying to write my own method that parses from a String to an int, and have two questions:
- When should I throw it? Java's
Integer.parseInt(String string)throws aNumberFormatExceptionwhen an invalid input is given (makes sense with it being a subclass ofIllegalArgumentException), and does not throwParseExceptionat all. - What is "
errorOffset"?ParseException's constructor forces you to give it a value - what does it mean?