Rewrite the following using Ternary operator: if (a>0) System.out.println("A”); else System.out.println("+B"); (a=0) ? System.out.print("A") : System.out.print("B"); a>o ? System.out.println("A') : System.out.println("B"); (a-0) ? System.out.println("A"): System.out.println("B"); O None of these
Answers
Answered by
1
Answer:
Rewrite the following using ternary operator:
if(income < 10000)
tax = 0;
else
tax = 12;public class PredictOutput2
{
public static void main(String args[])
{
int a = 6, b = 2, c = 3;
System.out.println("Output 1: " + (a == b * c));
System.out.println("Output 2: " + (a == (b * c)));
}
}
Explanation:
Similar questions