diff --git a/src/TD1/point/MainTestPoint.java b/src/TD1/point/MainTestPoint.java index df1e721..620c5b7 100644 --- a/src/TD1/point/MainTestPoint.java +++ b/src/TD1/point/MainTestPoint.java @@ -1,5 +1,11 @@ package TD1.point; +/******************************************************************************************** + * @author JunkJumper * + * @license https://creativecommons.org/licenses/by/4.0/ License CC BY 4.0 * + * @since File available since 20/05/2020 * + ********************************************************************************************/ + public class MainTestPoint { public static void main(String[] args) { @@ -103,6 +109,7 @@ public class MainTestPoint { System.out.println("C3 : " + C3.toString()); System.out.println("O3 : " + O3.toString()); + diff --git a/src/TD1/point/Point.java b/src/TD1/point/Point.java index 4653ace..0e2f05a 100644 --- a/src/TD1/point/Point.java +++ b/src/TD1/point/Point.java @@ -1,5 +1,11 @@ package TD1.point; +/******************************************************************************************** + * @author JunkJumper * + * @license https://creativecommons.org/licenses/by/4.0/ License CC BY 4.0 * + * @since File available since 20/05/2020 * + ********************************************************************************************/ + public class Point { private double x; @@ -43,23 +49,15 @@ public class Point @Override public boolean equals(Object obj) { Point p = (Point)obj; - if (this.x == p.x && this.y == p.y) { - return true; - } else { - return false; - } + return (this.x == p.x && this.y == p.y); } public Point clone() { return this; } - public void displayLocation() { - System.out.println("x = " + this.getX() + " , y = " + this.getY() + "."); - } - - public Point getLocation() { - return this; + public String displayLocation() { + return "x = " + this.getX() + " , y = " + this.getY(); } public void setLocation(Point p) {