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 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. [5 marks]
Step by Step Solution
There are 3 Steps involved in it
Heres an implementation of the countLines method in the FileUtility class that reads a binary byte file and counts the number of lines containing comm... View full answer
Get step-by-step solutions from verified subject matter experts
