Java.util.Date.clone() 方法


Java.util.Date.clone() 方法

package com.codingdict;

import java.util.*;

public class DateDemo {
   public static void main(String[] args) {

      // create a date
      Date date = new Date(98, 5, 21);

      // clone it to a second date
      Object date2 = date.clone();

      // print the results
      System.out.println("Original Date:" + date.toString());
      System.out.println("Cloned date :" + date2.toString());
   }
}