Java Locale clone() method

The clone() method of Java Locale class is used to create a copy of this locale. This method returns the clone of this instance.

Syntax

Parameter

NA

Return

This method returns a clone of this instance.

Example 1

Output:

Locale1:  company_JAVATPOINT
Locale2:  company_JAVATPOINT

Example 2

Output:

Locale1: company_JAVATPOINT
Locale2: branch_CS
Locale3: branch_CS

Example 3

Output:

Locale1: company_JAVATPOINT
Locale2: company_JAVATPOINT
Locale3: company-name_SSSIT
Locale4: company-name_SSSIT