1.

Rewrite the following using ternary operator: if (x%2 == o) System.out.print(“EVEN”); else System.out.print(“ODD”);

Answer»

String k; 

k = x%2 == 0 ? “EVEN” : “ODD”; 

System.out.print(k);



Discussion

No Comment Found

Related InterviewSolutions