Open In App

Java.util.Locale Class in Java | Set 2

Last Updated : 28 Jun, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

Java.util.Locale Class in Java | Set 1 
More methods: 
 

  1. getDisplayVariant() : java.util.Locale.getDisplayVariant() displays variant of the Locale 
    Syntax : 
public final String getDisplayVariant()
Parameters : 
----
Return :
-----------

  1.  
  2. getDisplayVariant(Locale in) : java.util.Locale.Locale in(Locale in) returns the variant of "in" locale. 
    Syntax : 
public final String getDisplayVariant(Locale in)
Parameters : 
in : the instance local
Return :
---- 

  1.  
  2. getISO3Language() : java.util.Locale.getISO3Language() displays 3-letter abbreviation of Locale Language. 
    Syntax : 
public String getISO3Language()
Parameters : 
----
Return :
-------------

  1.  
  2. getISOLanguages() : java.util.Locale.getISOLanguages() displays 2-letter abbreviation list of language as per ISO 639 
    Syntax : 
public static String[] getISOLanguages()
Parameters : 
----
Return :
-------------

  1.  
  2. getISOCountries() : java.util.Locale.getISOCountries() displays 2-letter abbreviation list of Countries as per ISO 3166. 
    Syntax : 
public static String[] getISOCountries()
Parameters : 
----
Return :
-------------

  1.  
  2. getVariant() : java.util.Locale.getVariant() returns variant code for the Locale. 
    Syntax : 
public String getVariant()
Parameters : 
----
Return :
-------------

  1.  
  2. getLanguage() : java.util.Locale.getLanguage() returns language code for the Locale which will be either empty or as per ISO 639 code in lowercases. 
    Syntax : 
public String getLanguage()
Parameters : 
----
Return :
-------------

  1.  
  2. hashCode() : java.util.Locale.hashCode() returns hashcode for the Locale 
    Syntax : 
public int hashCode()
Parameters : 
----
Return :
hashcode for the Locale.

  1.  
  2. toString() : java.util.Locale.toString() returns string representation of the entire Locale. 
    Syntax : 
public final String toString()
Parameters : 
----
Return :
string representation of Locale

  1.  
  2. setDefault(Locale newLocale) : java.util.Locale.setDefault(Locale newLocale) sets new value for the Locale for the JVM. 
    Syntax : 
public static void setDefault(Locale newLocale)
Parameters : 
----
Return :
string representation of Locale

  1.  

  1. Output : 
     
Use of getDisplayVariant : IND
Name of in Locale : 
Language of geek2 : eng

List of language codes : 
1:ab
2:ae
3:af
4:ak
5:am
6:an
7:ar
8:as

 Countries of geek2 : 
1:AE
2:AF
3:AG
4:AI
5:AL
6:AM
7:AN

Use of getVariant : IND
Use of getLanguage : english
HashCode for the geek1 : -322025782
String representation for the geek1 : english_IN_IND

Initial Default : en_US
NEW Default : fr_FRANCE_MAC


 


Next Article
Article Tags :
Practice Tags :

Similar Reads