title: Referencing user input string from another class?
body: <p>I'm trying to write a program that asks the user for input using the scanner class to name something. Then in a completely different class, reference that input. </p>
  
  <p>For example:</p>
  
  <pre><code>class TeamInfo {
      Scanner nScan = new Scanner(System.in);
  
  public String GetName(){
      String GetName = nScan.nextLine();
  
  }
  </code></pre>
  
  <p>The issue I'm having is that the first time I reference the GetName method in the TeamInfo class, it works--At the right spot, it prompts for the team name. </p>
  
  <p>However, it prompts for the team name every time after that. I can't seem to find anywhere online or in my Java Beginner's Guide how to make this input constant, so that I can reference the input. I'm also not entirely sure what it is I'm looking for, so that doesn't help. </p>
  
  <p>In other words, what I want is to prompt the user one time, and then remember that answer and re-use it again and again.</p>