像这种方法是线程安全的吗
方元之外 2018-11-09 05:39:28 public static long getCurrLongTime() {
return new Date().getTime();
}
public static Date getDate() {
return new Date();
}
像这样的方法不知道是不是线程安全的。感觉没有涉及带贡献数据。
可是方法感觉又像是,可以涉及带一个临时对象
public static Date getDate() {
Date d = new Date();
return d;
}