Javatpoint Logo
Javatpoint Logo

Java Locale getISO3Country() method

The getISO3Country() method of Java Locale class returns a three-letter abbreviation for this locale's country. If the locale doesn't specify a county, this method will return an empty string. Otherwise, this method will return an uppercase ISO 3166 3-letter country code.

Syntax

Parameter

NA

Return

This method returns a three-letter abbreviation of this locale's country.

Exception

MissingResourceException: This exception will throw if the three-letter country abbreviation is not available for this locale.

Example 1

Test it Now

Output:

Locale: english_IN
Country Name: IND

Example 2

Test it Now

Output:

Locale1 name: german_AU
Locale2 name: spanish_EC
Country Name of Locale1: AUS
Country Name of Locale2: ECU

Example 3

Test it Now

Output:

Locale1 name: german_AU
Locale2 name: spanish_EC
Locale3 name: french_BE
Country Name of Locale1: AUS
Country Name of Locale2: ECU
Country Name of Locale3: BEL
Next TopicJava Locale




Help Others, Please Share

facebook twitter pinterest