NumberFormat clone() method in Java with Examples Last Updated : 01 Apr, 2019 Comments Improve Suggest changes Like Article Like Report The clone() method is a built-in method of the java.text.NumberFormat returns a object which defines the clone of any given instance. Syntax: public Object clone() Parameters: The function does not accepts any parameter. Return Value: The function returns a object which defines the clone of any given instance. Below is the implementation of the above function: Program 1: Java // Java program to implement // the above function import java.text.NumberFormat; public class Main { public static void main(String[] args) throws Exception { // Get the percent Instance NumberFormat nF = NumberFormat .getPercentInstance(); // Print the clone of this instance System.out.println(nF.clone()); } } Output: java.text.DecimalFormat@674dc Program 2: Java // Java program to implement // the above function import java.text.NumberFormat; public class Main { public static void main(String[] args) throws Exception { // Get the Currency Instance NumberFormat nF = NumberFormat .getCurrencyInstance(); // Print the clone of this instance System.out.println(nF.clone()); } } Output: java.text.DecimalFormat@67500 Reference: https://docs.oracle.com/javase/10/docs/api/java/text/NumberFormat.html#clone() Comment More infoAdvertise with us Next Article NumberFormat clone() method in Java with Examples G gopaldave Follow Improve Article Tags : Java Java-Functions Java-text package Java-NumberFormat Practice Tags : Java Similar Reads TreeMap clone() Method in Java with Examples In Java, clone() method of the TreeMap class is used to return a shallow copy of the mentioned treemap. It just creates a copy of the map. --> java.util Package --> TreeMap Class --> clone() Method Syntax: Tree_Map.clone() Parameters: The method does not take any parameters. Return Type: A 2 min read Properties clone() method in Java with Examples The Java.util.Properties.clone() method is used to create a shallow copy of this instance with all the elements from this Properties instance. Syntax: public Object clone() Parameters: The method does not take any parameter Return Value: The function returns the cloned Object which is the shallow co 2 min read TimeZone clone() Method in Java with Examples The clone() method of TimeZone class in Java is used to create an identical copy of an existing this TimeZone. Syntax: time_zone.clone() Parameters: The method does not take any parameters. Return Value: The method returns an instance of TimeZone which is the copy of this TimeZone. Below program ill 1 min read RuleBasedCollator clone() method in Java with Example The clone() method of java.text.RuleBasedCollator class is used to get the copy of this Collator object.Syntax: public Object clone() Parameter: This method does not accept any parameter.Return Value: This method returns the copy of this Collator object.Below are the examples to illustrate the clone 2 min read Stack clone() method in Java with Example The clone() method of Stack class is used to return a shallow copy of this Stack. It just creates a copy of the Stack. The copy will have a reference to a clone of the internal data array but not a reference to the original internal data array. Syntax: Stack.clone()Parameters: The method does not ta 2 min read Like