public class Vector2D private double private double public double getX

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class Vector2D {
private double x;
private double y;
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
public Vector2D() {
this(0,0);
}
public Vector2D (double x, double y) {
this.x = x;
this.y = y;
}
public Vector2D add (Vector2D) {
return new Vector2D
}
}