I have a Float variable which is initialised from a function returning the Float value, and there can be chance to return null in some cases. So I need to check the value in the variable is null or empty. If the value is empty I need to initialise variable wb1 with value 1. I am using Java Spring. This is the code currently I amusing,
Float wb1 = !StringUtils.isEmpty(getArea())?getArea() : 1.0f;
What is the correct way to check and initilize with value 1.0f