new Locale(String language, String country, String variant)
import java.util.Locale;
public class MainClass {
public static void main(String args[]) throws Exception {
Locale defaultLocale = Locale.getDefault();
System.out.println(defaultLocale.getDisplayVariant());
System.out.println(defaultLocale.getDisplayVariant(Locale.US));
System.out.println((new Locale("en", "US", "WIN_TX_Austin")).getDisplayVariant());
}
}
Home
Java Book
Essential Classes
Java Book
Essential Classes
Locale:
- Locale class
- Locale.ITALY
- Use Locale with DateFormat
- new Locale(String language, String country, String variant)
- getDefault()
- getDisplayCountry()
- getDisplayCountry(Locale inLocale)
- getDisplayLanguage()
- getDisplayName()
- getDisplayVariant()
- getISOCountries()
- getISOLanguages()
- setDefault(Locale newLocale)