Online Java Compiler By
JavaTpoint.com
import java.util.*; public class LocaleGetDisplayCountryExample4 { public static void main(String[] args) { // Creating a new Locale Locale locale1 = new Locale("English", "IN"); // display locale System.out.println("Locale name: "+ locale1); // Use of getDisplayCountry(Locale in) System.out.println("Country name of in locale1: " + locale1.getDisplayCountry(new Locale("GERMAN", "GERMANY"))); } }
Output