Java Locale getISOLanguages() method7 Nov 2024 | 1 min read The getISOLanguages() method of Locale class returns a list of all 2-letter language codes defined in ISO 639. This method can be used to create Locales. SyntaxParameterNA Return ValueThis method doesn't return any value. Example 1Output: Locale1: en_INDIA Languages are: 0:aa 1:ab 2:ae 3:af 4:ak 5:am 6:an 7:ar 8:as 9:av 10:ay 11:az 12:ba 13:be 14:bg 15:bh 16:bi 17:bm 18:bn 19:bo 20:br 21:bs 22:ca 23:ce 24:ch 25:co 26:cr 27:cs 28:cu 29:cv 30:cy 31:da 32:de 33:dv 34:dz 35:ee 36:el Example 2Output: Locale: ja_JAPAN Countries are: 0:aa 1:ab 2:ae 3:af 4:ak 5:am 6:an 7:ar 8:as Next TopicJava-locale-getlanguage-method |
The getDisplayVaiant() method of Java Locale class is used to return a name for the locale's variant code that is appropriate for display to the user. This method returns the empty string if the locale doesn't specify a variant code. Syntax public final String getDisplayVariant() Parameter NA Example 1 import java.util.*; public class...
3 min read
The getLanguage() method of Java Locale class is used to return the language code of this Locale. Syntax public String getLanguage() Parameter NA Return This method returns the language code or the empty string if none is defined. Example 1 import java.util.*; public class LocaleGetLanguageExample1 { public static void main(String[] args) { ...
1 min read
The getISO3Country() method of Java Locale class returns a three-letter abbreviation for this locale's country. If the locale doesn't specify a county, this method will return an empty string. Otherwise, this method will return an uppercase ISO 3166 3-letter country code. Syntax public String getISO3Country() Parameter NA Return This method returns a...
2 min read
The object represents a specific geographic, cultural, or political region. It is a mechanism to for identifying objects, not a container for the objects themselves. A Locale object logically consists of the fields like languages, script, country, variant, extensions. Syntax public final class Locale extends...
3 min read
The getDisplayCountry() method of Java Locale class returns a name for the locale's country that is appropriate for display to the user. Syntax public final String getDisplayCountry() Parameter NA Return It does not return any value. Example 1 import java.util.*; public class LocaleGetDisplayCountryExample1 { public static void main(String[] args) { // Creating a new Locale ...
3 min read
The hashCode() method of Java Locale class returns a hash code for this locale. This method overrides the hashCode. Syntax public int hashCode() Return It returns a hash code value for this locale. Example 1 import java.util.*; public class LocaleHashCodeExample1 { public static void main(String[] args) { // create a new locale ...
1 min read
The equals() method of Java Locale class returns true if this Locale is equal to another object. A Locale is deemed equal to another Locale with identical language, variant, country, extension, script, and unequal to all other objects. Syntax public boolean equals(Object obj) Parameter obj: It is the reference...
3 min read
The toString() method of Locale class is used to return a string representation of this Locale object, consisting of language, country, variant, script, and extensions. Syntax public final String toString() Parameter NA Return This method returns a string representation of the Locale, for debugging. Example 1 import java.util.*; public class LocaleToStringExample1 { public...
2 min read
The getDefault() method of Java Locale class is used to get the current value of the default locale for this instance of the JVM(Java Virtual Mchine). Syntax public static Locale getDefault() Return It returns the default locale for this instance of the Java Virtual Machine Example 1 import java.util.*; public class LocaleGetDefaultExample1...
1 min read
The getISO3Language() method of Java Locale class returns a three-letter abbreviation for this locale's language. If the locale doesn't specify a language, this method will return an empty string. Otherwise, this method will return an uppercase ISO 3166 3-letter language code. Syntax public String getISO3Language() Parameter NA Return value This method returns...
2 min read
We request you to subscribe our newsletter for upcoming updates.
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