if Java Keyword

The if keyword indicates conditional execution of a block. The condition must evaluate to a boolean value.

Examples

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

Remarks

Related Topics

boolean Java Keyword

else Java Keyword