File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Loops?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Loops??" Watch "Loops??" New topic


srikanth reddy
Ranch Hand

Joined: Jul 28, 2005
Posts: 252

please help me with the process...iam getting 8,5...

here what happens when break and continue of if statement is executed??
[ October 20, 2005: Message edited by: srikanth reddy ]

Thanks & Regards<br /> <br />-Srikanth
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

By adding some System.out.printlns and making it prettier.

Hope that helps.

I' never can understand why comd eCODE tags has the text small and some larger.

[ October 20, 2005: Message edited by: Mark Spritzler ]

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Running in a different low priority thread to Mark (on paper ) I reckon you just forgot that after the last comparison i++ < j-- jumped out of the loop, i and j had been incremented respectively decremented. That is 8,5 gets you out of the loop but then i is 9 and j is 4. Makes you dizzy eh?

Actually I had problems doing one like this on the real exam - at the same time there were three people trying to get the PC next to me working.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
srikanth reddy
Ranch Hand

Joined: Jul 28, 2005
Posts: 252
barry i didnt get u ....try to get pc means...
also barry if these sort of questions comes on exam in 1 means fine ..but if they are many i shall go mad ..also yesterday i was doing these dan questions ..i was right almost all..but my head was roaming here and there ...u got it what i mean ???
Joseph Clark
Ranch Hand

Joined: Sep 10, 2005
Posts: 48
Can we bring pencil and scratch paper to the test? I can do these problems quicker if I can write down what happens in the iterations.
Ray Horn
Ranch Hand

Joined: Oct 20, 2005
Posts: 39
The testing center will provide pencil & paper. Not allowed to bring your own. I had to also check my jacket. Nothing else allowed in (bags, cell phones, etc).
I agree. Here's the link:
subject: Loops??
It's not a secret anymore!