title: Use of the if statement
body: <p>I'm beginner  in Java, and I'm learning the if statement <em>without</em> <code>else</code>, can please the community check my code to improve?</p>
  
  <p><strong>Problem statement:</strong>
  In this code we use only the if statement to practice. Here you need to enter your age to enter to the bar with hot girls, if your age is above to 18, you can enter.
     if it is below 18 you can't enter.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Main {
      public static void main(String[] args){
  
          Scanner input = new Scanner(System.in);
  
          int age;
  
          // Ask the age
          System.out.println("Please write your age to enter to the bar:");
          age = input.nextInt();
  
          // Equal to
          if(age == 18){
              System.out.println("Your age " + age + " it's equal to 18, you can enter");
          }
  
          // Not equal to
          if(age != 18){
              System.out.println("Your age " + age + " it's not equal to 18");
          }
  
          // Greater than
          if(age &gt; 18){
              System.out.println("Your age " + age +  " " + "is greater than 18, you can enter");
          }
  
          // Less than
          if(age &lt; 18){
              System.out.println("Your age " + age + " " + "is less than 18, you can't enter");
          }
  
          // Greater than or equal to
          if(age &gt;= 18){
              System.out.println("Your age " + age + " is greater than or equal to 18, you can enter");
          }
          // Less than or equal to
          if(age &lt;= 18){
              System.out.println("Your age " + age + " is less than or equal to 18, you can't enter");
          }
      }
  }
  </code></pre>