...的一无所知,所以默认只是对各个域 浅拷贝 , 这对于基本类型和不可变类型(如String类型)没有问题,但是对于可变类(mutable class)却会出问题.
基于24个网页-相关网页
If you are creating a mutable class m, you should be prepared to write a lot more documentation about the treatment of references to m than if m were immutable.
如果您要创建一个可变类m,那么您应该准备编写比m是不可变的情况下多得多的文档说明,以说明怎样处理m的引用。
Inner classes can refer to mutable instance fields if the inner-class expression occurs in an instance context, but this is not the same thing.
如果内部类表达式出现在某个实例上下文中的话,内部类可以引用可变的实例域instance field,但这不是同一回事。
The class that is shown in the previous example is mutable.
前面示例中所示的类是可变的。
应用推荐