PPT Slide
public Integer convertNumber (String strToConvert) {
for (int i =0; I < strToConvert.length(); i++) {
char chTemp = strToConvert.charAt(i);
if (!Character.isDigit(chTemp)) {
if (DEBUG) System.out.println
(“Bad input String: “ + strToConvert);
throw new NumberFormatException(“Exception: “ +
strToConvert + “ is not numeric”);
When to Use Exceptions: Bad Parameters