Is that Point some class which you’d implemented by yourself? ![]()
If so, you can simply declare that it extends PVector: ![]()
class Point extends PVector {
Point() {
}
Point(final float x, final float y) {
this(x, y, 0);
}
Point(final float x, final float y, final float z) {
super(x, y, z);
}
}
Now, the same sort() function can accept both the superclass PVector or its subclass Point transparently. ![]()