1 | public class Shape { |
2 | protected double x_ = 0.0; |
3 | protected double y_ = 0.0; |
4 | protected double width_ = 0.0; |
5 | protected double height_ = 0.0; |
6 | |
7 | public synchronized double x() { |
8 | return x_; |
9 | } |
10 | public synchronized double width() { |
11 | return width_; |
12 | } |
13 | // ... |
14 | } |