91-9990449935 0120-4256464 |
Java If-else StatementThe Java if statement is used to test the condition. It returns true or false. There are various types of if statement in java.
Java IF StatementThe if statement tests the condition. It executes the if statement if condition is true. Syntax: Example: Output: Age is greater than 18 Java IF-else StatementThe if-else statement also tests the condition. It executes the if block if condition is true otherwise else block. Syntax: Example: Output: odd number Java IF-else-if ladder StatementThe if-else-if ladder statement executes one condition from multiple statements. Syntax: Example: Output: C grade
Next TopicJava Switch Statement
|