title: printing content of array row wise & columnwise
body: <p>here is code:</p>
  
  <pre><code>import java.io.File;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Scanner;
  public class ReadFileContents {
      public static void main(String[] args) throws IOException {
      Scanner s = new Scanner(new File("rfg.txt"));
      List&lt;float[]&gt; list = new ArrayList&lt;float[]&gt;();
      while (s.hasNextLine()) {
          String[] line = s.nextLine().split(" ");
          list.add(new float[] { Float.parseFloat(line[0]),Float.parseFloat(line[1]),Float.parseFloat(line[2]) });
          }  
          int numberOfRows = list.size();
          int numberOfColumns = 3; 
          float[][] floatValues = new float[numberOfRows][numberOfColumns];
          for (int i = 0; i &lt; numberOfRows; i++) {
              floatValues[i] = list.get(i);
              System.out.println(floatValues[i][0] + " " + floatValues[i][1] + " " + floatValues[i][2]);
              }
          }   
   }
  </code></pre>
  
  <p>here is .txt file:</p>
  
  <pre><code>5.1 3.5 1.4 2.0     
  4.9 3.0 1.4 40.1    
  4.7 3.2 1.3 1.4     
  4.6 3.1 1.5 5.1             
  5.0 3.6 1.4 4.1                 
  5.4 3.9 1.7 9.4         
  4.6 3.4 1.4 4.5         
  5.0 3.4 1.5 3.51        
  4.4 2.9 1.4 4.0         
  4.9 3.1 1.5 1.45 
  </code></pre>
  
  <p>it gives o/p of only 3 columns:</p>
  
  <p>but i want to print the file which is having the same dimension as given in file(file with "n*m" dimension). dimensions can be changed as per the given file.</p>