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
}