title: What does scanner.close() do?
body: <p>Say I have the following example code:</p>
  
  <pre><code>Scanner scan1 = new Scanner(System.in);    // declaring new Scanner called scan1
  int x = scan1.nextInt();    // scan for user input and set it to x
  System.out.println(x);    // print the value of x
  scan1.close();    // closes the scanner (I don't know exactly what this does)
  Scanner scan2 = new Scanner(System.in); // declaring new Scanner called scan1
  int y = scan2.nextInt();    // scan for user input and set it to y
  System.out.println(y);    // print the value of y
  </code></pre>
  
  <p>I read the <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html" rel="noreferrer">Oracle documentation on the <code>Scanner</code> class</a> and came across this:</p>
  
  <blockquote>
    <p>When a Scanner is closed, it will close its input source if the source implements the Closeable interface.</p>
  </blockquote>
  
  <p>Does this mean that once a <code>Scanner</code> (of <code>System.in</code>) is closed, I will no longer be able to use <code>System.in</code> throughout the entire Java program? Or does it mean I will no longer be able to use it throughout the class? Or only the method? Or only its scope?</p>
  
  <p>Another question I have is, is a Scanner restricted to the scope it was declared in (similar to the primitive data types)?</p>