This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
There is a similar Self Test question in K&B 1.5 (p. 305).
I too would like to know any kind of trick to speed up the time needed to solve this kind of problem. I got the problem right, but it took at least 15 minutes. That�s with pencil, paper and no stress. I just tried it again watching the time and it still took me 8 minutes to solve. That�s 8 minutes to solve a problem I had solved not that long ago, maybe 5 days ago. If there�s more than one question like this on the exam I feel I am doomed.
Joined: Mar 16, 2007
Sorry to reply to sharan late. I am really busy these days, and I don't have too much to prepare SCJP. I only get 73% in whizlab for practice 4. I think I said this in my other post. I didnot do the final test yet.
Thank you, Sharan. You are so smart to solve these kinds of questions quickly. For me, I have to give up in the realy exam. And it's definitely doomed if there are more than 2 questions in the exam. [ April 26, 2007: Message edited by: Sam Sunamin ]
Is there any trick to solve such kind of questions? What way you followed to answer this???
Joined: Apr 16, 2007
Sorry for the late reply. I used a bottom top approach. This might seem very vague but please don't mind. The final result required was -49 in x and so if I use a use something like x-=y where in x = 1 and y = 50 . x can be made equal to 1 by using a /= on x itself whatever may be the value of x, and before doing this get the value of y = 50 by doing x*=y; y+=x;