-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathField.java
More file actions
50 lines (40 loc) · 913 Bytes
/
Copy pathField.java
File metadata and controls
50 lines (40 loc) · 913 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
39
40
41
42
43
44
45
46
47
48
49
50
public class Field {
private double xpos, ypos, length, width;
//constructor
public Field(double x, double y, double l, double w){
xpos = x;
ypos = y;
length = l;
width = w;
}
//getters
public double getXpos() {
return xpos;
}
public double getYpos() {
return ypos;
}
public double getLength() {
return length;
}
public double getWidth() {
return width;
}
//setters
public void setXpos(double x) {
xpos = x;
}
public void setYpos(double y) {
ypos = y;
}
public void setLength(double l) {
length = l;
}
public void setWidth(double w) {
width = w;
}
//toString to dsplay values of instance variables
public String toString(){
return ("Field: [" + xpos + ", " + ypos + "]" + length + "," + width);
}
}