Java Locale getCountry() methodThe getCountry() method of Java Locale class returns the country/region code for this locale. This code can either be the empty string, an uppercase ISO 3166 2-letter code. If none is defined, this method will return the empty string. SyntaxParameterNA ReturnThe getCountry() method returns the country/region code. This method returns empty string if none is defined. Example 1Test it NowOutput: Locale Name: english_IN Country Name: IN Example 2Test it NowOutput: Locale1 name: german_AU Locale2 name: spanish_EC Country Name of locale1: AU Country Name of locale2: EC Example 3Test it NowOutput: Locale1 name: german_AU Locale2 name: spanish_EC Locale3 name: french_BE Country Name of Locale1: AU Country Name of Locale2: EC Country Name of Locale3: BE
Next TopicJava Locales
|