public void test(int x) { int odd = 1; if(odd) /* Line 4 */ { System.out.println('odd'); } else { System.out.println('even'); } }Which statement is true? - Study24x7
Social learning Network
23 Feb 2023 04:39 PM study24x7 study24x7

public void test(int x) { int odd = 1; if(odd) /* Line 4 */ { System.out.println("odd"); } else { System.out.println("even"); } }Which statement is true?

A

Compilation fails

B

"odd" will always be output.

C

"even" will always be output.

D

"odd" will be output for odd values of x, and "even" for even values.

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles