title: File letter counter errors
body: <p>Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. </p>
  
  <p>My problem is that length and charAt on lines 24 and 25 error, and I'm not sure what to do in order to get the program to run.</p>
  
  <pre><code>import java.util.Scanner;
  import java.io.*;
  public class challenge6 {
      public static void main(String[] args) throws Exception {
  
          String string;
          char character;
          int count = 0; 
  
          File file =   new File("./file.txt");
          Scanner input = new Scanner(file);
          input.hasNextLine();
  
          while (input.hasNextLine())
              System.out.println(input.nextLine());
  
          System.out.println("enter name of a char");
          character = input.next().charAt(0);    
  
          for(int i=0; i &lt; input.length(); i++)
          {    if(input.charAt(i) == character)
              count++;
          }
  
          System.out.println(count);}}
  </code></pre>