Question: In Java TASK: Write a public static method called writeMessage that has a parameter of type String called message followed by a parameter of type
In Java

TASK: Write a public static method called writeMessage that has a parameter of type String called message followed by a parameter of type String called filename. It should write message into a new file with filename filename, and it should not return anything. EXAMPLE: Calling writeMessage("Hello, World!", "message.txt") would result in the creation of a new file called message.txt containing the following text: Hello, World! NOTE: I had to write my own hack-y FileWriter class to get things to work on Stepik, so it only supports the FileWriter(String fileName) constructor and the write(String str) and close() methods. If you try to use anything outside of these, it will break Sample Input: Hello, World! message.txt Sample Output: CORRECT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
