title: Process words in a scanner to string array
body: <p>I am fairly new to programming and am trying to devise a way to create a method with multiple parameters. A scanner, a string array of words, a string array matching the word array with how many times the word is used, and an integer with how many words are in the string array. My goal is to process the words in the scanner one by one, if a word in the scanner is also in the word array I want to add one to the int array, if a word is not the word array I want to add it to the word array at the first null space on the array and add one to the int array at the same location as the word. The goal of the method is to return how many words are in the word array after processing the words in the scanner. My first attempt pulls a nullPointerException on the .equals(). 
  My Method</p>
  
  <pre><code>public static int scanScanner(Scanner s,String[] words, int[] wordCount, int wordsInWordsArray) {
      for(int i = 0; i &lt; words.length; i++) {
          String currentToken = s.next();
          if(words[i].equals(currentToken)) {
              wordScore[i]=+lineScore;
              wordCount[i]++;
          }
          else {
              words[wordsInWordsArray] = currentToken;
              wordScore[wordsInWordsArray]=+lineScore;
              wordCount[wordsInWordsArray]++;
              wordsInWordsArray++;
          }
      }
      return wordsInWordsArray;
      }
  </code></pre>