I was wondering what is the best way to document this potential class Point:
public class Point {
private int x;
private int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
}
My specific problem is repeating between attributes xand yand their respective getters and setters, as well as with constructor arguments.
Itβs not that I was developing a public API or something like that, itβs not a problem for me to have a general comment regarding a variable, and then if the recipient and the setter have the same text, for example. I just would like to avoid repeating comments in my own inner code. Is there a way to bind an argument getX()and int xconstructor to an attribute x, for example?
thank