Yes, it prints:
Default Locale = en_GB value = 123,456,789
The language is english and the country is Great Britain. Locales specify both language and country.
DecimalFormat Objects
import java.util.Locale;
import java.text.*;
class IODemo
{
public static void main ( String[] args )
{
int value = 123456789 ;
System.out.println( "Default Locale = " + Locale.getDefault() );
DecimalFormat decform = new DecimalFormat();
System.out.println( "value = " + decform.format(value) );
}
}
The program uses a DecimalFormat object.
Its format() method converts a number
into an appropriately formatted String.
The default locale determines the format
used when a number is converted into characters.
The number may be a primitive (such as int or double)
or a wrapper object (such as Integer or Double).
The program uses the default behavior of DecimalFormat.format().
Later you will see methods that further
affect the output of format().
(Review :) What three characters might be used to separate the digits of an integer into groups of three, depending on your location?