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.
public void setID(String ID)
Parameters: The method takes one parameter ID of String type which refers to the new ID of the TimeZone.
Return Value: The method does not return any value.
Below programs illustrate the use of setID() method of TimeZone class:
The ID is: GMT+05:00
The ID is: GMT+05:30
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.