title: Passing two parameters from txt file to object using Scanner.next() twice. Result: "Unknown Source"
body: <p>I have a text file containing some data, separated by white-space. </p>
  
  <p>I have a constructor that accepts two types of data: </p>
  
  <pre><code>constructor(short members, int income){
      this.members = members;
      this.income = income;
  }
  </code></pre>
  
  <p>What I want to accomplish is to, in one swoop, pass the first number as a short, and the second number as an int, to one object.</p>
  
  <p>My text file resembles this:</p>
  
  <pre><code>1 22229
  2 27674
  3 34022
  4 41307
  5 46850
  6 52838
  7 58827
  </code></pre>
  
  <p>My code resembles this:</p>
  
  <pre><code>public static void main (String[] args) throws IOException {
  
          Scanner fileScan;
  
          fileScan = new Scanner (new File("survey.txt"));
  
  
          List&lt;Household&gt; houseList = new ArrayList&lt;Household&gt;();
  
          while (fileScan.hasNext()) {
              System.out.println(fileScan.nextLine());
  
              /*
              houseList.add(new Household((short) fileScan.nextInt(),
                      fileScan.nextInt()));
              */
          }
  
          for (int i = 0; i &lt; houseList.size(); i++) {
              System.out.println(houseList.get(i).toString());
          }
      }
  </code></pre>
  
  <p>I want it to work in such a way that </p>
  
  <pre><code>this.members = 1;
  this.income = 2324;
  </code></pre>
  
  <p>If I pass either item to the object individually it runs, but when using nextInt() twice there is an error of "Unknown Source".</p>
  
  <p>If there is a way to make this work, or a work-around to get this effect, I would much appreciate your help.</p>
  
  <p>Thank you, and sorry if this question has already been answered.</p>