< a > , , .
, :
public class Test {
private int x;
private void change(Test test) {
test.x = test.x + 1;
}
public static void main() {
Test test1 = new Test();
Test test2 = new Test();
test1.change(test2);
}
}
:
public class Test2 {
public static void main() {
Test1 test1 = new Test1();
test1.clone();
}
}
</a >
toString(), equals(Object), hashCode() getClass() on all objects makes things a lot easier.
clone() finalize() . , , . , , .
, , Sun , "" notify(), notifyAll(), wait(long), wait (long, int). , Object , Lock-. , , , .