Question: Write a class called FileOperations that accepts a string value in a variable called str which represents the name of a text file residing on

 Write a class called FileOperations that accepts a string value in

Write a class called FileOperations that accepts a string value in a variable called str which represents the name of a text file residing on an external storage device. Provide the following: (a) A constructor that accepts the string str, representing the file name, and creates a LineNumberReader object. [1 mark] (b) A mutator method that reads the file line by line until the file is empty. (c) An accessor method that determines if the actual file exists. (d) An accessor method that returns the number of bytes in the file. (e) An accessor method that returns the name of the file. (1) The declaration of appropriate variables and use of Exception where necessary. [2 marks] 2 marks] 1 mark] [ 1mark] 1 mark] Note -a test class is NOT required

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!