Java Locale Clone() Example

Locale class Clone() method example. This example shows you how to use Clone() method.


Syntax is : public Object clone()
This method returns clone object of this object of Locale class.

Here is the code.

/**
 * @(#) CloneLocale.java
 * A class representing use of method Clone() of Locale class
 in java.util Package.
 * @Version  24-May-2008
 @author   Rose India Team
 */
import java.util.*;

class CloneLocale {
    public static void mainString args[] ){
    /* Create object of Locale class using contructor 
    Locale(String language, String country) */
    Locale objLocale = new Locale("ENGLISH","US");
  System.out.println"Object of Locale class is : " + objLocale);
  // Clone() method call.
    Object objClone = objLocale.clone();
    System.out.println"Create Clone object successfully!");
    System.out.println"New clone object is : " + objClone);
  }
}

Output of the program.
Object of Locale class is : english_US
Create Clone object successfully!
New clone object is : english_US

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US