Creating a temporary copy of a Calendar Object in Java -
i need figure out how create temporary calendar object (a copy of "permanent" calendar exists) can manipulate copy: tempcal.add (unit, value). need keep original calendar object unchanged, don't want call add(unit, value) on directly.
since none of attempts @ creating copy worked, current ugly hack call permanentcal.add(unit, value), display desired results, call permanentcal.add (unit, -value) -- seems, uncool.
java.util.calendar
has clone
method, use that. data in made of primitives, not run troubles.
have @ these answers:
Comments
Post a Comment