-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPoint2D.java
More file actions
executable file
·38 lines (33 loc) · 887 Bytes
/
Copy pathPoint2D.java
File metadata and controls
executable file
·38 lines (33 loc) · 887 Bytes
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
32
33
34
35
36
37
38
/**
* @author Todd Pickell CISS 238
* Chapter
* Programming Challenge pg
*/
class Point2D extends Object {
private double x, y;
//int constructor
Point2D(int x, int y) {
setX(x);
setY(y);
}
//float constructor
Point2D(float x, float y) {
setX(x);
setY(y);
}
//double constructor
Point2D(double x, double y) {
setX(x);
setY(y);
}
//X property
double X() { return x; }
public void setX(double x) { this.x = x; }
public void setX(float x) { this.x = (double) x; }
public void setX(int x) { this.x = (double) x; }
//Y property
double Y() { return y; }
public void setY(double y) { this.y = y; }
public void setY(float y) { this.y = (double) y; }
public void setY(int y) { this.y = (double) y; }
}