if statement syntax question
I am in a computer science academic event and in the practice tests, they give a code fragment and ask what the output will be. I know that the if statement can be notated like:
Code :
if (someBoolean){
someEvent}
But the test sometimes write the if statement like:
Code :
if (something; somethingElse; somethingElseElse;)
I need to know how to understand the second example. What does it mean and what kind of things go before each semicolon?
Re: if statement syntax question
Quote:
Originally Posted by
lanmonster
But the test sometimes write the if statement like:
Code :
if (something; somethingElse; somethingElseElse;)
I need to know how to understand the second example. What does it mean and what kind of things go before each semicolon?
That is not valid Java code.
Re: if statement syntax question
*derp* got mixed up. They do for statements like that, which is probably the right way to do it. I have not learned the for statement yet. My bad :P