PPT Slide
When to use exceptions: Internal State
public int getAge(int iSocialSecurityNumber)
throws RecordKeepingException
int index = getHashKey(iSocialSecurityNumber);
int iAge = myArray[index].getAge(iSocialSecurityNumber);
/* Similar to util.ASSERT( ) statement. */
throw new RecordKeepingException
(“Exception: Age for “ + iSocialSecurityNumber +
“ not in range: “ + iAge);