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

Output:

Locale: english_IN
Country Name: IND

Example 2

Output:

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

Example 3

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