Is there any exceptions to be avoided in this simple class?
This is from a practice exam, anyhow, I was thinking, what are t开发者_如何学Gohe exception that I should take care of?
Thanks.
I think obvious runtime exceptions mean here NullPointerException, ArrayOutOFBoundsException, IllegalArgumentException and so on, so your code will run without obvious failures.
The first one that comes to mind is NullPointerException
if you're doing anything with the name. For instance, if Employee's or SessionalEmployee's toString() were do anything with the name other than displaying it...
精彩评论