import java.io.*; // for File import java.util.*; // for Scanner public class Ch14_13 // input a text file line by line and given a line stored in a String, count each character, word and line { // throws an IOException if the file does not exist or there is a file error public static void main(String[] args) { Scanner s=null; // declare the Scanner here since it is referenced in finally block, have to initialize it to null to appease the Java compiler int characters=0,words=0,lines=0; // declare these here because they will be referenced in try and finally try{ // try to open and access the File File f; f=new File("input.txt"); // open the File s=new Scanner(f); // set the Scanner to access the File String line; // line used to store the entire line at one time while(s.hasNext()) // if there is another line, continue { line=s.nextLine(); // get the full line for(int i=0;i