Java Date clone() Method

The clone() method of Java Date class returns a copy/clone of this object. This method overrides clone in class Object.

Syntax:

Parameters

NA

Return

It returns a clone/copy of this instance.

Example 1

Test it Now

Output:

Clone of your Date 'd' : Mon Oct 21 00:00:00 IST 3918

Example 2

Test it Now

Output:

Clone of your Date 'd' : Sat Apr 10 00:00:00 IST 3897

Next Topicjava.util.Date




Latest Courses