暂无个人介绍
今天在看AtomicInteger的乐观锁实现(CAS);读源码发现它的死循环式是这么写的 /** * Atomically decrements by one the current value. * * @return the previous value
克隆的优点 克隆相对于new一个新对象的时间开销要少,因为clone出的对象不会执行对象的Construstorf方法。这样就节省了一些时间。这是Java 代码优化的一个点。 我们看下代码证明下: public class Man implements Cloneable{ pu