title: How to have a range of numbers in an if/else statement Java
body: <p>I'm learning Java through a series of explanations and exercises, and one of them was to create a program that would display a number grade (0-5) in accordance to a number of points (0–29, 30–34, 35–39, 40–44, 45–49, 50–60).</p>
  
  <pre><code>System.out.println("Type the points [0-60]: ");
  double points = reader.nextDouble();
  reader.nextLine();
  if (points &lt; 29) {
      System.out.println("Grade: FAILED.");
  } else if (points &lt;= 34) {
      System.out.println("Grade: 1.");
  } else if (points &lt;= 39) {
      System.out.println("Grade: 2.");
  } else if (points &lt;= 44) {
      System.out.println("Grade: 3.");
  } else if (points &lt;= 49) {
      System.out.println("Grade: 4.");
  } else if (points &gt;= 50) {
      System.out.println("Grade: 5.");
  }
  </code></pre>
  
  <p>The program works in that it'll give the correct grade because of the overlap in commands, but is there any way to create a range of numbers or strings that could meet the condition of the if/else statement? For example, if the number entered is between 40-44 and so on. Detailed answer would be appreciated since I'm new.</p>