title: Proper way to get User Input from Console
body: <p>I have a little question for you brilliant people!</p>
  
  <p>I'm in the process of making a little console game, nothing too fancy, but certainly not simple, and would like to figure out a more efficient way to do something! That something I would like to do is get input from the user!</p>
  
  <p>From the beginning I was taught to use Scanners to get user input from a console! So that's what I have always used! Below is an example of what I would write.</p>
  
  <pre><code>package com.mattkx4.cgamedev.main;
  
  import java.util.Scanner;
  
  public class Main {
      public static void main(String[] args) {
          // Print out a message asking the user if ready
          System.out.println("Are you ready to continue? (Enter \"YES\" or \"NO\")");
  
          // Initialize a Scanner
          Scanner s = new Scanner(System.in);
  
          // Initialize a String to hold the User Input
          String in = s.nextLine();
  
          // Check the input with IF statements
          if(in.equalsIgnoreCase("YES")) {
              System.out.println("Let's continue!");
          }else if(in.equalsIgnoreCase("NO")) {
              System.out.println("Goodbye!");
              s.close();
              System.exit(0);
          }else{
              System.out.println("Please input a correct response!");
              main(null);
          }
      }
  }
  </code></pre>
  
  <p>I'm absolutely sure there is a more efficient or easier way to do this! Any suggestions would be appreciated!</p>
  
  <p>Thanks in advance
  -Matthew</p>