Example usage for java.util Locale clone

List of usage examples for java.util Locale clone

Introduction

In this page you can find the example usage for java.util Locale clone.

Prototype

@Override
public Object clone() 

Source Link

Document

Overrides Cloneable.

Usage

From source file:Main.java

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

    // print this locale
    System.out.println("Locale1:" + locale1);

    // create a second locale
    Locale locale2;/*from   w  w  w  .j av a2s.c  om*/

    // clone locale1 to locale2
    locale2 = (Locale) locale1.clone();

    System.out.println("Locale2:" + locale2);
}