OCA exam question????
Posted: Wed Jan 11, 2017 9:22 pm
int x= 10%2
int y= 3/5 + ++x;
int z += 4 * x;
System.out.print(x", "y "," z);
The answer for this question is code does not compile because of line 4 as z is not declared before compound assignment.but what I selected is code does not compile because of line 3 because int x needed to be corrected as double x to compile.... Which answer is correct....
int y= 3/5 + ++x;
int z += 4 * x;
System.out.print(x", "y "," z);
The answer for this question is code does not compile because of line 4 as z is not declared before compound assignment.but what I selected is code does not compile because of line 3 because int x needed to be corrected as double x to compile.... Which answer is correct....