Online Java Compiler By
JavaTpoint.com
import java.util.*; public class LocaleToStringExample1 { public static void main(String[] args) { // create a new locale Locale locale1 = new Locale("ENGLISH", "IN", "IND"); // print locale System.out.println("Locale1 name: " + locale1); // print the locale as a string System.out.println("String representation of Locale1: " + locale1.toString()); } }
Output