Java Locale(String language) Constructor

Syntax

Locale(String language) constructor from Locale has the following syntax.

public Locale(String language)

Example

In the following code shows how to use Locale.Locale(String language) constructor.


import java.util.Locale;
/*ww w .j  a  va2  s  . com*/
public class Main {

   public static void main(String[] args) {
      Locale locale = new Locale("ENGLISH");

      System.out.println("Locale:" + locale);

      System.out.println("Display Name:" + locale.getDisplayCountry());

   }
}