Menu

Question 7 Write Method Countlines String Infilename Class Fileutility Reads Binary Byte F Q43785170

Please answer the below question in Java, thankyou.Question 7 Write a method countLines (String inFilename) of a class FileUtility which reads a binary byte file with name inFi

Question 7 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 ‘n’. You may write other methods if necessary. Handle possible exception by outputting a suitable message if an exception occurs. Show transcribed image text Question 7 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 ‘n’. You may write other methods if necessary. Handle possible exception by outputting a suitable message if an exception occurs.

Expert Answer


Answer to Question 7 Write a method countLines (String inFilename) of a class FileUtility which reads a binary byte file with name…

OR