Link to home
Start Free TrialLog in
Avatar of renisenbe
renisenbe

asked on

Java if-else shorthand

if (getNo() != null ? !compareNo(getNo(), b.getNo()) : getNo() != null) {
  return 100;
}

Assuming getNo() is not null, does this mean that "return 100" runs if !compareNo(getNo(), b.getNo()) evaluates to true? What happens to the last expression (after the :)
ASKER CERTIFIED SOLUTION
Avatar of Jan Louwerens
Jan Louwerens
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of renisenbe
renisenbe

ASKER

Thanks, very clear.