title: java- How to use scanner in fields and constructors?
body: <p>Okay so here's what I have to do.</p>
  
  <pre><code>Scanner data = new Scanner(new File("moby.txt"));
  CharacterCounter empty = new CharacterCounter();        // provide default constructor, initialize all Class fields
  CharacterCounter working = new CharacterCounter(data);  // reads data from file, contains all the code to read file
  </code></pre>
  
  <p>So I have to make a class that will end up counting characters. I have a good idea of how to do that, I am just struggling with making fields/constructors.</p>
  
  <p>I think I really just need to make a single field, with data. </p>
  
  <p>This is what I have so far</p>
  
  <pre><code>//fields
  public static Scanner scanner;
  //constructors
  public CharacterCounter(){
  
  }
  public CharacterCounter(Scanner input){
      this.scanner = input;
  }
  </code></pre>
  
  <p>I don't believe I did the field right, nor the constructor right. And I don't even know how to fill out the empty constructor. Anyways, if I want to create methods to work with this Scanner data, how do I make a scanner field?
  Thanks!</p>