标签:des class blog code java http
Every now and then, I come across various newbies Java developers who are found to get stuck with some of the following common exceptions where I need to explain them all over again. I do believe that this is same with many other senior Java developers who try and help these rookie developers to deal with following exceptions. Thus, I thought of coming up with this article and use it for myself going forward. Please feel free to comment or add to the below exceptions list.
The most easy and common way to get over this type of exception is to add a NOT-NULL check. However, sooner than later, it becomes a practice of Java developer and you find NOT-NULL check everywhere. Interestingly, it is not considered as good coding practice to put NOT-NULL check everywhere. And, the primary reason why the NOT-NULL check practice is used is that developers tend to pass null object for failure cases. Instead, the good coding practice that should be propagated to programmers is to pass an empty object in case the primary/happy path of the program is not satisfied. This would , in turn, reduce NOT-NULL check. However, adoption of this coding practice is easier said than done.
Note that index starts at 0 and goes upto 1 less than the size of the array.
6 Java Exceptions that Haunts a Newbie Java Developer(Java菜鸟6种常见的异常),布布扣,bubuko.com
6 Java Exceptions that Haunts a Newbie Java Developer(Java菜鸟6种常见的异常)
标签:des class blog code java http
原文地址:http://www.cnblogs.com/tian2fei/p/3796515.html