Possible Duplicate:
How to get the first non-null value in Java?
I have the following operation
function1(function2(param1,param2));
if function2 returns null I would like it to be replaced with a zero. I could do this a number of ways but is there some shortcut notation for this? For example, is there anything along the lines of this
function1(function2(param1,param2)==null || "0")
Note: function 2 returns a string.
how about
btw, you can only use this if function2 doesn’t make any permanent changes to any data because it’s called twice and if it does, then you might get a different answer the second time.