Question: Write a method countLines (String inFilename) of a class FileUtility which reads a binary byte file with name inFilename using FileInputStream. The method returns

Write a method countLines (String inFilename) of a class FileUtility which reads

 

Write a method countLines (String inFilename) of a class FileUtility which reads a binary byte file with name inFilename using FileInputStream. The method returns the no. of lines containing comments starting with "//" with optional spaces (but not other characters) before it. Each line is terminated by ' '. You may write other methods if necessary. Handle possible exception by outputting a suitable message if an exception occurs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the implementation of the countLines method in the FileUtility class java import javaio public ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!