Locale locale = new Locale("en", "US");
Locale locale = new Locale("fr", "CA", "CA");
Locale locale = Locale.getDefault();
String language = locale.getLanguage();
String country = locale.getCountry();These examples use the java.util.Locale package library to work with localized data in Java programs.