Can someone explain this in Java? Prompt:
Part 8: Java Source Code Reformatter (10 points)
Filename: ReformatCode.java
Note: You will need to create the file given above yourself. Starting files are not provided for this part of the assignment.
Write a program that reformats Java source code from the next-line brace style to the end-of-line brace style. The program is invoked from the command line with the input Java source code file as args[0] and the name of the file to save the formatted code in as args[1]. The original file is left untouched. The program makes no other changes to the source code, including whitespace.
For example, the following command converts the Java source code file "Test.java" to the end-of-line brace style:
java ReformatCode Test.java Test2.java
Test.java:
public class Test
public static void main (String[] args)
System.out.println("Test 1")
System.out.println("Test 2")
The above source code would be reformatted into the following code, which is then saved as "Test2.java":
public class Test{ public static void main (String[] args) System.out.println("Test 1") System.out.println("Test 2")