I want to add a null check to my ternary operator which checks on a Boolean isValue
:
public String getValue() {
return isValue ? "T" : "F";
}
My task is:
What if the Boolean(object) return null? Add a boolean check and return "" (empty String in case if its null).
Note that isValue
is a Boolean
, not boolean
.