Page 1 of 1

OCA exam question????

Posted: Wed Jan 11, 2017 9:22 pm
by sulakshana
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....

Re: OCA exam question????

Posted: Thu Jan 12, 2017 3:21 am
by admin
Did you find this question in our question bank? If so, please mention the question id. Otherwise, please mention the source so that we can look it up.

Re: OCA exam question????

Posted: Thu Jan 12, 2017 5:32 am
by sulakshana
I got this question from practice exam in oca sybex test bank...