Program to count the number of lines in a file using LineNumberReader

Program to count the number of lines in a file

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;

public class ReadWriteLineNumber {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {
            /*
           File f=new File("E://core//io//NB//myfile.txt");
           FileReader fr=new FileReader(f);
           LineNumberReader lnrs=new LineNumberReader(fr);
           */
        
        
            LineNumberReader lnr = new LineNumberReader(new FileReader(new File("E://core//io//NB//myfile.txt")));
            int ln = 0;
            while (lnr.readLine() != null){
                ln++;
            }
            System.out.println("Total number of lines : " + ln+" Length of file: "+f.length());
            lnr.close();

    }
}