0

example
if (...){
return 0;
}
else (...){
return 1;
}

that do they mean?


thnaks in advance

4
Contributors
5
Replies
7
Views
9 Years
Discussion Span
Last Post by masijade
0

That the method returns an int (as its declaration will show), and these are the lines that do that, obviously.

0

example
if (...){
return 0;
}
else (...){
return 1;
}

that do they mean?


thnaks in advance

I'd say they mean you'll be getting some errors while compiling this
the (...) in this example is only applicable for the if - part

if(test){
           // what to do if 'test' is 'true'
}
else{
          // what to do if 'test' is 'false'
}

I'm sure that with the explanations you have gotten so far, you will beyond any doubt understand what the other lines do, and when they are applied.

-1

if it returns zero, it means your if statement is true. else (if your statement is false) it will return 1

Votes + Comments
You resurrected a 3-year-old thread to post this?
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.