Advertisements
Advertisements
Question
Rewrite the following using ternary operator.
if (income < 10000)
tax = 0;
else
tax = 12; One Line Answer
Advertisements
Solution
int tax = (income < 10000) ? 0 : 12shaalaa.com
Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 44]
