format of formatter. Good and well explained answers shall be marked as the BRAINLIEST.
Share
format of formatter. Good and well explained answers shall be marked as the BRAINLIEST.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:The following example shows the usage of java.util.Formatter.flush() method.
package com.tutorialspoint;
import java.util.Formatter;
import java.util.Locale;
public class FormatterDemo {
public static void main(String[] args) {
// create a new formatter
StringBuffer buffer = new StringBuffer();
Formatter formatter = new Formatter(buffer, Locale.US);
// format a new string
String name = "World";
formatter.format("Hello %s !", name);
// print the formatted string with default locale
System.out.println("" + formatter + " " + formatter.locale());
}
}