I'm fiddling with a basic code that utilizes methods to create values, and I want it to write into a text file and format the values, however the \n in my printf statements will not actually indent the solution.
File surfaceG = new File("SurfaceGravity.txt");
surfaceG.createNewFile();
PrintWriter write = new PrintWriter(surfaceG);
String placer = "";
write.printf("%5sPlanetary Data\n", placer);
write.printf("%10sPlanet, placer);
write.close();
The solution I'm aiming for is
Planetary Data
Planet
However the solution this code will give is
Planetary Data Planet
Why won't the \n in my printf statements compute through to the textfile?