You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* num1 is not equal to 10, so the second value after colon is assigned
* to the variable num2
*/
num2 = (num1 == 10) ? 100 : 200;
System.out.println( "num2: " + num2);
num2 = (num2 = 25) ? 100: 200;
System.out.println("num2: " + num2);
}
}
/*
If the expression results true then the first value before the colon (:) is assigned to the variable num1 else the second value is assigned to the num1.
*/
/* Operator Precedence in Java
* This determines which operator needs to be evaluated first: