Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started