Created
May 18, 2018 16:42
-
-
Save GertjanBrouwer/67fd3920765d669a83dfc7825e5dee5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tspsim; | |
public class Product implements Cloneable{ | |
private int id; | |
private int x; | |
private int y; | |
public Product(int id, int x, int y) { | |
this.id = id; | |
this.x = x; | |
this.y = y; | |
} | |
public int getId(){ | |
return this.id; | |
} | |
public int getX() { | |
return this.x; | |
} | |
public int getY() { | |
return this.y; | |
} | |
public String toString() { | |
return "id:" + String.valueOf(this.id) + " x:" + String.valueOf(this.x) + " y:" + String.valueOf(this.y); | |
} | |
public Product clone() throws CloneNotSupportedException{ | |
Product clone = (Product)super.clone(); | |
return clone; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment