import java.util.Formatter;
import java.io.File;
import java.io.FileNotFoundException;
public class EgWriteToFile1
{
public static void main(String[] args)
throws FileNotFoundException
{
Formatter out = new Formatter(new File("out.output"));
out.format("Hi, %4d and %6.2f \n",12, 5.6343);
out.format("Write string %s \n","Hello");
out.close();
System.out.println("Done");
}
}
==================================
Hi, guys.
I ran the code, then in the generated file. I can only find
==================================
Hi, 12 and 5.63 Write string Hello
==================================
could someone told me what happened to the red parts in the codes?
Thank you!