Java Core Fundamentals - Practice Test 6
Casual Mode - Take your time!
1 / 25
Correct
0
Incorrect
0
Score
0%
Multiple Choice
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?
- Compilation fails.
- odd will always be the output.
- even will always be the output.
- odd will be the output for odd values of x, and even for even values.