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 1Output: Locale Name: english_IN Country Name: IN Example 2Output: Locale1 name: german_AU Locale2 name: spanish_EC Country Name of locale1: AU Country Name of locale2: EC Example 3Output: 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-locale-getdefault-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India