Yahoo free web hosting - 527Chapter 28PEARif StatementsA simple two-test ifstatement should be
527Chapter 28PEARif StatementsA simple two-test ifstatement should be formatted like this: if ((condition1) && (condition2)) { doSomething(); } Note that the opening bracket appears on the same line as the conditions (so-called Kernighanand Ritchie, or K&R, braces), and that there are brackets even though there is only one line of code in the conditional block. That way, the fact that it s a block is obvious, and there s noneed to remember to add them when further lines of code are added in the future. Also notethat there should be a space between a conditional statement and the expression being tested. if/else StatementsAn if/elsestatement builds on the basic ifformat: if ((condition1) && (condition2)) { doSomething(); } else { doSomethingElse(); } The elseappears on the same line as the closing bracket that terminates the ifblock. if/elseif StatementsAn if/elseifstatement looks just like an if/elsestatement in terms of formatting: if ((condition1) && (condition2)) { doSomething(); } elseif { doSomethingElse(); } switch StatementsSwitchstatements rely on whitespace and indentation to make code blocks obvious: switch ($flag) { case 1: doWork(); break; case 2: doOtherWork(); break; default: doNothing(); break; }
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services