• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For loop clarification

 
Kk Krish
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI frndz,
having a doubt in for loop .Shal we declare like this .
for(int i=0;i<=5;(intArray[i] == 3)break;i++).
Theoritically i no that we cant.Please Suggest me y we cant.
Here instead of break please use continue also...no pbms
Is it possible in java/c in some other languages? Thanks in advance
 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use clear and simple English. No short cuts
 
Matthew Raw
Ranch Hand
Posts: 76
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
this code you wrote is a nonsense. The for loop in Java consists of three parts:
1. the initial statement
2. the condition, under which the the code can proceed with the itetration
3. the iteration expression
You have four expressions there, so the code will not compile.
You can rewrite your loop to this form in order to compile:
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Advise : UseRealWords
 
Stephen Davies
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abimaran Kugathasan wrote:My Advise : UseRealWords


I think you meant "Use Real Words" as 'UseRealWords' is not a real word !
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic