SimpleTimeZone clone() method in Java with Examples Last Updated : 02 Jan, 2019 Comments Improve Suggest changes Like Article Like Report The clone() method of SimpleTimeZone class returns a clone of this SimpleTimeZone instance. Syntax: public Object clone() Parameters: The function does not accept any parameter. Return Value: Returns a clone of this instance. Exception: The function does not throws any exception. Program below demonstrates the above mentioned function: Program 1: Java // program to demonstrate the // function java.util.SimpleTimeZone.clone() import java.util.SimpleTimeZone; public class GFG { public static void main(String[] args) { // create simple time zone object SimpleTimeZone obj = new SimpleTimeZone(520, "India"); // clone the object and print System.out.println("Clone object : " + obj.clone()); } } Output: Clone object : java.util.SimpleTimeZone [ id=India, offset=520, dstSavings=3600000, useDaylight=false, startYear=0, startMode=0, startMonth=0, startDay=0, startDayOfWeek=0, startTime=0, startTimeMode=0, endMode=0, endMonth=0, endDay=0, endDayOfWeek=0, endTime=0, endTimeMode=0 ] Program 2: Java // program to demonstrate the // function java.util.SimpleTimeZone.clone() import java.util.SimpleTimeZone; public class GFG { public static void main(String[] args) { // create simple time zone object SimpleTimeZone obj = new SimpleTimeZone(120, "India"); // clone the object and print System.out.println("Clone object : " + obj.clone()); } } Output: Clone object : java.util.SimpleTimeZone [ id=India, offset=120, dstSavings=3600000, useDaylight=false, startYear=0, startMode=0, startMonth=0, startDay=0, startDayOfWeek=0, startTime=0, startTimeMode=0, endMode=0, endMonth=0, endDay=0, endDayOfWeek=0, endTime=0, endTimeMode=0 ] Comment More infoAdvertise with us Next Article SimpleTimeZone clone() method in Java with Examples T Twinkl Bajaj Follow Improve Article Tags : Misc Java Java - util package Java-Functions Java-SimpleTimeZone +1 More Practice Tags : JavaMisc Similar Reads 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 SimpleTimeZone equals() method in Java with Examples The equals() method of SimpleTimeZone class is used to compare the equality of two SimpleTimeZone objects. Syntax: public boolean equals(Object obj) Parameters: The function accepts a single parameter obj which is a SimpleTimeZone object to be compared with. Return Value: The method returns two valu 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 setID() Method in Java with Examples The setID(String ID) method of TimeZone class in Java is used to set the time zone ID of this TimeZone. While this operation no other data of the time zone object is changed. Syntax: public void setID(String ID) Parameters: The method takes one parameter ID of String type which refers to the new ID 1 min read 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 Like