Question : java 8 if else in one statement
Answered by : vijay-pawan-chemuturi
myVariable = (testCondition) ? someValue : anotherValue;
Source : https://stackoverflow.com/questions/8898590/short-form-for-java-if-statement | Last Update : Tue, 12 Jul 22
Question : java 8 if else in one statement
Answered by : clear-constrictor-e944slt604zz
name = ((city == null) || (city.getName() == null) ? "N/A" : city.getName());
Source : https://stackoverflow.com/questions/8898590/short-form-for-java-if-statement | Last Update : Thu, 02 Dec 21