开发者

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?

Is there any exceptions to be avoided in this simple class?

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜