title: Cannot instantiate the type Scanner
body: <p>I am new to Java. I want to read input through scanner.
  I am getting error as cannot 'instantiate the type scanner'.</p>
  
  <pre><code>import java.util.*;  
  import java.io.File;  
  
  public class Factors {  
  
  //string declaration  
  static String filename;  
  
  public static void main(String args[]){  
      //scanner initialization, needs to be done in every program that reads from user  
      Scanner input = new Scanner(System.in);  
      int caseIndex=0;  
  
      //prompts user for filename  
      System.out.println("Please enter the name of the file you would like to read from.");  
      filename = input.nextString();  
  
      //checks if filename exists  
      if(input.exists())  
          System.out.println(inp.getName() + "exists!");  
      else  
          System.out.println("File name does not exist!");  
  
  
  
   }  
  
  }
  </code></pre>
  
  <p>I am not understanding where i am lacking.
  Please help. Thank you in advance.</p>