title: file input from the user
body: <p>I was trying to take the input of the filename from the user and then proceed to doing all the calculations. but it keeps returning me an error. the file exists in the same directory.</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  public class test{
  public static void main(String args[]) throws FileNotFoundException {
  //File fin = new File ("matrix1.txt");
  Scanner scanner = new Scanner(System.in);
  scanner.nextLine(); // removes the first line in the input file 
  String rowLine = scanner.nextLine();
  String[] arr = rowLine.split("=");
  int rows = Integer.parseInt(arr[1].trim());
  
  String colLine = scanner.nextLine();
  String[] arr2 = colLine.split("=");
  int cols = Integer.parseInt(arr2[1].trim());
  double [][]matrix = new double [rows][cols];
  
   for (int i=0; i&lt;rows;i++){
       for (int j=0; j&lt;cols;j++) {
           matrix[i][j]= scanner.nextDouble();
          } 
  }
  
  
  System.out.println(rows);
  System.out.println(cols);  
  
   for (int i=0; i&lt;rows; i++) 
    { for (int j=0;j&lt;cols;j++) {
      System.out.println(matrix[i][j]);
   }   
  }   
  </code></pre>
  
  <p>}
      }</p>