Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Point {
- private int x, y;
- private final int DEFAULT_X = 1;
- private final int DEFAULT_Y = 1;
- public Point() {
- this.x = DEFAULT_X;
- this.y = DEFAULT_Y;
- }
- public Point(int x, int y) {
- this.x = x;
- this.y = y;
- }
- public Point(Point p) {
- this.x = p.x;
- this.y = p.y;
- }
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- public void set(int x, int y) {
- this.x = x;
- this. y = y;
- }
- /* WHAT IS THE POINT OF THESE METHODS???
- public double distance(Point p) {
- }
- public double getDistance(Point p) {
- }
- */
- @Override
- public String toString() {
- return "Point(" + x + ", " + y + ")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement