else Java Keyword

The else keyword is always used in association with the if keyword in an if-else statement. The else clause is optional and is executed if the if condition is false.

Examples

  if (condition)
  {
     <statements>
  }
  else
  {
     <statements>
  }
  

Remarks

None.

Related Topics

if Java Keyword