title: java split method to arrays
body: <p>I have a data like below:</p>
  
  <pre><code>3.3 John
  3.9 Jim
  3.5 Kathy
  3.2 Steve
  2.4 Stacy
  2.8 Faith
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>File StudentGrade = new File("data.txt");
      Scanner reader = new Scanner(StudentGrade);
      int size = reader.nextInt();
      //debug: System.out.println(size);
  
      String[] gradeArr = new String[size];// array created for grades
      //debug: System.out.println(gradeArr);
      String[] nameArr = new String[size];//array created for name
      String[] temp = new String[100];// array created for temporary array
      int index = 0;//index indicator
  
      while (reader.hasNextLine()) {
          String s = reader.nextLine();
          //System.out.println(s);
          temp = s.split("\\s+");
          gradeArr[index] = temp[0];
          nameArr[index] = temp[1];
          System.out.println("grades= "+ gradeArr[index]+ " name = "+ nameArr);
          index++;
      }
  </code></pre>
  
  <p>It has to be split to 2 arrays, one is for the numbers, another is for names.
  I can get the numbers to <code>temp[]</code>, but I don't know how to convert names to another array. Please teach me. </p>