譬如Writer定义就用一个lock,
public abstract class Writer implements Appendable, Closeable, Flushable {
/**
* The object used to synchronize operations on this stream. For
* efficiency, a character-stream object may use an object other than
* itself to protect critical sections. A subclass should therefore use
* the object in this field rather than <tt>this</tt> or a synchronized
* method.
*/
protected Object lock;
。。。
}
看了英文解释,说是有利于子类,但是具体好处没说清楚。
哪里提到内部类了???
无参构造器不是赋值this吗?