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
- resource bundle — A set of locale-specific texts, looked up by key, that ResourceBundle.getBundle chooses for a locale.
- NumberFormat — The java.text class whose factory methods format and parse numbers, currency and percentages for a locale.
Taught in
- Paths And Files With NIO.2 — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Locales, Resource Bundles And Formatting — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: I/O And Localization — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Mock Exam: Sit It, Score It — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Encodings, Locales And Time Zones — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep
- Mock Exam 102-500 — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep