Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Flow Controls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Flow Controls" Watch "Flow Controls" New topic
Author

Flow Controls

Shreelakshmi Sridhar
Greenhorn

Joined: Apr 11, 2004
Posts: 3
The output for the following program says i=0,j=-1 can anybody explain the flow...

Thanks in advance
Code tags added and re-formatted - Barry
[ April 11, 2004: Message edited by: Barry Gaunt ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It's a good idea with these problems to instrument the code a little by introducing some System.out.println statements, thus:


The output is:

Is it clearer now what's happening?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Shreelakshmi Sridhar
Greenhorn

Joined: Apr 11, 2004
Posts: 3
i got it thanks for that...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Flow Controls