title: Why do I have to create a new Scanner? when creating a driver
body: <p>As you can see this is a fragment of a code that I am working on. My question is why do I have to create a new scanner to be able to input? why can't I just use <code>stdIn.nextLine();</code> instead? If you can include some references I will really appreciate it. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class Week6{
  
      public static void main(String[]args){
      Horse horse1;
      Horse horse2;
      Horse horse3;
      String name;
      int age;
      double height;
      String color;
      boolean pureBlood;
      Scanner in = new Scanner(System.in);
  
      horse1 = new Horse(); // creation of Horse1
      horse2 = new Horse(); // creation of horse2
      horse3 = new Horse(); // creation of horse3
  
      System.out.print("Enter the name of Horse1: ");
      name = in.nextLine();
  
      horse1.setName(name); //setting name for horse1
  
      System.out.println(horse1.getName());
  
  
  
      } // end main
  } // end class
  </code></pre>