Forum

> > Off Topic > Java for problem
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

Englisch Java for problem

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Java for problem

archmage
User Off Offline

Zitieren
I know a lot of you study a language other than Lua so I thought you might know Java. Well I am studying Java and I am having trouble with the for loop. This i just a test obviously it is not an app just a test for experience.
Mehr >


I get an error saying "i can not be resolved" I also get "syntax error on token else"

alt Re: Java for problem

YellowBanana
BANNED Off Offline

Zitieren
Dark Byte hat geschrieben
I know a lot of you study a language other than Lua so I thought you might know Java. Well I am studying Java and I am having trouble with the for loop. This i just a test obviously it is not an app just a test for experience.
Mehr >


I get an error saying "i can not be resolved" I also get "syntax error on token else"


1
for ( int i = 30; i > 0; i--)  //dont put a semicolon here..
Also u dont have to use the else{continue;} part, because it will automatically continue lol.

alt Re: Java for problem

archmage
User Off Offline

Zitieren
thanks
but what about the else why does it not work i tried taking it out mbut it still prints 15

edit
oh i had a semicolon after the if

well here is the final (not that any one would want it)
Mehr >
1× editiert, zuletzt 26.06.10 02:56:55
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht