calendar.getInstance() or calendar.clone()
Posted
by Pangea
on Stack Overflow
See other posts from Stack Overflow
or by Pangea
Published on 2010-04-07T20:19:19Z
Indexed on
2010/04/07
20:23 UTC
Read the original article
Hit count: 252
java
|Performance
I need to make a copy of a given date 100s of times (I cannot pass-by-reference). I am wondering which of the below two are better options
newTime=Calendar.getInstance().setTime(originalDate);
OR
newTime=originalDate.clone();
Performance is of main conern here.
thx.
© Stack Overflow or respective owner