This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
How to predict the output for the below question? I got it from Master Exam.. Please help!
1) It'll keep on printing values which show x and y always as equal and increasing by 1 at each line.
2) It'll keep on printing values which show x and y always as different.
3) Nothing can be said about the sequence of values.
4) It'll keep on printing values which show x and y always as equal and increasing but may increase more than 1 at each line.
I can tell that both values will in a increasing order, but, will they(x and y) be equal? In that question both increments(x++; y++;) in the same line.
And when I run it, both gave same value (when the incrementation is in the same line). But, If I insert those Line 01 and Line 02, They(x and y) differs.
How to approach these kind of question?
Thanks in Advanced!
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|