Java String judgement for null value.

知识共享许可协议
Work by Jianfei is licensed under a Creative Commons wei 3.0 Unported License.

 

It's better to take a look this code line in below, before we using a judgement code statement to verify a string value

 

 

1:  if ( ( objectA.getStringValue() != null&& (objectA.getStringValue().length() != 0) )

2if (objectA.getStringValue().length() != 0&& ( objectA.getStringValue() != null

 

 

After run those code command in java, you will see an exception for code line 1 . But the code line 2 is passed. So the 

sequential execution in java for expression AND is very important for us.

知识共享许可协议
Work by Jianfei is licensed under a Creative Commons wei 3.0 Unported License.

 

posted on 2011-05-09 14:49  zencorn  阅读(199)  评论(0编辑  收藏  举报