Thursday, July 26, 2012

Check If Any Number of Objects Are Null

Here is a little snippet of code that is useful when you need to check if any of a bunch of objects are null. Instead of writing if (object 1 == null || object 2 == null || object3 == null) you can write if(MyUtility.hasNullValue(object1, object2, object3))

The Code! and test

No comments:

Post a Comment