带有初始值设定项的 final
字段和 transient
字段被视为不必复制。
示例:
class Point {
private int x;
private int y;
Point(int x, int y) {
this.x = x;
this.y = y;
}
Point(Point other) {
// 字段 x 和 y 未初始化
}
}
2018.1 最新变化