Javatpoint Logo
Javatpoint Logo

Java Locale getDisplayCountry() method

The getDisplayCountry() method of Java Locale class returns a name for the locale's country that is appropriate for display to the user.

Syntax

Parameter

NA

Return

It does not return any value.

Example 1

Test it Now

Output:

Locale name: english_IN
Country Name: India

Example 2

Test it Now

Output:

Locale1 name: german_AU
Locale2 name: spanish_EC
Country Name: Australia
Country Name: Ecuador

Example 3

Test it Now

Output:

Locale1 name: german_AU
Locale2 name: spanish_EC
Locale3 name: french_BE
Country Name of Locale1: Australia
Country Name of Locale2: Ecuador
Country Name of Locale3: Belgium

Java Locale getDisplayCountry() method

The getDisplayCountry(Locale inLocale) method of Java Locale class returns a name for the locale's country that is appropriate for display to the user. If possible, the name returned will be localized according to inLocale.

Syntax

Parameter

NA

Return

This method does not return any value.

Example 4

Test it Now

Output:

Locale name: english_IN
Country name of in locale1: India

Example 5

Test it Now

Output:

Locale1 name: german_AU
Locale2 name: spanish_EC
Country name of in locale1: Australia
Country name of in locale2: Ecuador

Next TopicJava Locale



Help Others, Please Share

facebook twitter pinterest