Java Locale getDisplayCountry() methodThe getDisplayCountry() method of Java Locale class returns a name for the locale's country that is appropriate for display to the user. SyntaxParameterNA ReturnIt does not return any value. Example 1Test it NowOutput: Locale name: english_IN Country Name: India Example 2Test it NowOutput: Locale1 name: german_AU Locale2 name: spanish_EC Country Name: Australia Country Name: Ecuador Example 3Test it NowOutput: 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() methodThe 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. SyntaxParameterNA ReturnThis method does not return any value. Example 4Test it NowOutput: Locale name: english_IN Country name of in locale1: India Example 5Test it NowOutput: Locale1 name: german_AU Locale2 name: spanish_EC Country name of in locale1: Australia Country name of in locale2: Ecuador
Next TopicJava Locale
|