In java is there a way to avoid having to nest null checks on each level of the call to ensure there were no nulls along the way which prevent the next call. Is there an elegant way to do this?
for example:
objOne.objTwo.objThree.objFour.objFive
if(objOne.objTwo!=null){
if(objOne.objTwo.objThree!=null){
if(objOne.objTwo.objThree.objFour!=null){
...
}
}
}