locale

A java.util object naming a language and optionally a country and variant, used to format text, numbers and dates for that audience.

In more detail

Locale.of("fr", "CA") builds one, and constants name common ones, such as Canadian French. Locale.getDefault() is used when no locale is given. Since Java 19 the Locale constructors are deprecated in favour of Locale.of.

Example

NumberFormat.getCurrencyInstance(Locale.GERMANY).format(1234.5)

Related terms

Taught in

References

Certification courses