Код: Выделить всё
class Point {
int x, y, z;
public Point(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public **synchronized** int getSum() {
return x + y + z;
}
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... ized-objec