learning to use exceptions in Java