Planet For Application Life Development Presents
MY IT World

Explore and uptodate your technology skills...

JAVA - If-else Statement

The Java if statement is used to test the condition. It checks boolean condition: true or false. There are various types of if statement in java.

  • if statement
  • if-else statement
  • if-else-if ladder
  • nested if statement

Java IF Statement

The Java if statement tests the condition. It executes the if block if condition is true.

Syntax:

  1. if(condition){  
  2. //code to be executed  
  3. }