Question: In java TASK: Write a public static method called readMessage that has a parameter of type String called filename. It should read the contents of

In java TASK: Write a public static method called readMessage that hasIn java

TASK: Write a public static method called readMessage that has a parameter of type String called filename. It should read the contents of the file with filename filename and return the resulting String EXAMPLE: If I had a file called message.txt with the following contents: Hello, World! Calling readMessage("message.txt") would return "Hello, World!" NOTE: I had to write my own hack-y FileReader class to avoid forcing you all to do more Linux challenges, so it only supports the FileReader(String fileName) constructor and the read() method (which reads a single character as an int that you can cast to char). If you try to use anything outside of these, it will break Sample Input: Hello, World! message.txt Sample Output: Hello, World

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!