title: How to add elements stored in a file to an array?
body: <p>I have a file which contains data elements as follows:</p>
  
  <pre><code>1749 12426 19597 38042 43350 52873 67704 75875 81829 96307
  
  11615 16454 20015 27021 52762 66631 70625 83951 96527 96893
  
  3370 5530 28692 39087 50591 59442 61906 69337 70643 91162
  
  1947 4604 9657 16455 21149 22739 32809 66089 73871 97304
  
  3429 5325 7888 24101 28851 31637 32424 57991 62470 65017
  </code></pre>
  
  <p>I am facing problem to add each element of the file on different index of array. While searching from internet i was only able to store all of the first row on index array[0].
  (All line was stored on the index[0])</p>
  
  <p>I want to store all the column elements array </p>
  
  <pre><code>array[0] = 1749 
  array[1] = 11615 
  array[2] = 3370
  array[3] = 1947
  array[4] = 3429
  </code></pre>
  
  <p>In second pass:</p>
  
  <pre><code>array[0] = 12426
  array[1] = 16454
  array[2] = 5530 
  array[3] = 4604 
  array[4] = 5325 
  </code></pre>
  
  <p>And so on up to 10th pass.....
  PLEASE make necessary changes in the code given below:</p>
  
  <pre><code>File            file = new File("SortedLines.txt");
  FileInputStream fis  = null;
  
  try {
      fis = new FileInputStream(file);
  
      int content;
  
      while ((content = fis.read()) != -1) {
          // convert to char and display it
          System.out.print((char)content);
      }
  } catch (IOException e) {
      e.printStackTrace();
  } 
  </code></pre>