Does this count as a single if statement or two?
Code :if (condition){ statement } else if (condition){ statement } else{ statement }
Any help appreciated
Printable View
Does this count as a single if statement or two?
Code :if (condition){ statement } else if (condition){ statement } else{ statement }
Any help appreciated
Depends what you mean by single if statement.
Some people consider a "single if statement" to be an if statement with only one statement, where you wouldnt need the brackets to run that statement:
Code java:if(condition) statement; else statement;
Others could take "single if statement" as a check where there is no else condition:
Code java:if(condition) { statement; } //continue with program
Other still could consider a "single if statement" as a situtation with no nested if statements, which is what you have above. And still others could consider a "single if statement" as a situation with no else if statements. I dont think the term "single if statement" has a definitive meaning.