Different Types Of Writing If Else Statements Jav Code Example

Snippet 1

  int x = 3;

if (x<=3){
 System.out.println("Hello World");
}

else {
 System.out.println("Bye World");
} 

Snippet 2

  if (condition) {
  // block of code to be executed if the condition is true
}
 

Copyright © Code Fetcher 2020

 

 

Published

Leave a comment

Your email address will not be published. Required fields are marked *