Quickest way to clone a GregorianCalendar?

前端 未结 4 1853
说谎
说谎 2020-12-11 00:15

I\'m trying to make a deep copy of an object, including a GregorianCalendar instance. I\'m always wary of using clone() and it doesn\'t seem to hav

4条回答
  •  悲&欢浪女
    2020-12-11 00:53

    Uh, clone() sucks.

    Is it that hard? You only have to set 3 things, I believe, the time, the time zone, and the locale. All those fields have getters and setters. Make a quite utility method to return a copy?

提交回复
热议问题