-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriangle.java
More file actions
110 lines (77 loc) · 1.75 KB
/
Triangle.java
File metadata and controls
110 lines (77 loc) · 1.75 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package org.ribhu.javabrains;
import java.util.List;
public class Triangle {
// private String type;
//
// private int height;
//
// public int getHeight() {
// return height;
// }
//
// public Triangle(String type) {
//
// this.type = type;
//
// }
//
// public Triangle(int height) {
//
// this.height = height;
//
// }
//
// public Triangle(String type, int height) {
//
// this.type = type;
// this.height = height;
//
// }
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }
private Point pointA;
private Point pointB;
private Point pointC;
public Point getPointA() {
return pointA;
}
public void setPointA(Point pointA) {
this.pointA = pointA;
}
public Point getPointB() {
return pointB;
}
public void setPointB(Point pointB) {
this.pointB = pointB;
}
public Point getPointC() {
return pointC;
}
public void setPointC(Point pointC) {
this.pointC = pointC;
}
private List<Point> points;
public List<Point> getPoints() {
return points;
}
public void setPoints(List<Point> points) {
this.points = points;
}
public void draw() {
// System.out.println( this.getType() +" Triangle Drawn of height " + this.getHeight());
System.out.println("PointA Equals = ( " + this.getPointA().getX() + " , " + this.getPointA().getY() + " ) ");
System.out.println("PointB Equals = ( " + this.getPointB().getX() + " , " + this.getPointB().getY() + " ) ");
System.out.println("PointC Equals = ( " + this.getPointC().getX() + " , " + this.getPointC().getY() + " ) ");
}
/*public void draw() {
for (Point point : points) {
System.out.println( " Point = ( " + point.getX() + " , " + point.getY() + " )");
}
}*/
}