I have 2 string variables autoCollateral
and secureCollateral
. I need to set the value of collateral
to have the value of the variable that has a non-null value.
I wrote the code as
if(autoCollateral!=null){
collateral=autoCollateral
}
if(secureCollateral!=null){
collateral=secureCollateral
}.
If both has value I need to set any of them...what is the most optimized way to do this?