Accessing functions from Java Generics

That’s too bad that a class can only be used for 1 object type. :slightly_frowning_face: Thanks for all the examples you did, though! Since I use to use P5.js, a class could take in any object type, so I assumed Processing would be able to do the same thing then. In that case, I’ve decided to just do something like this (Using Sorter as an example):

class Sorter {
  Object[] points;
  Sorter(Object[] points_) {
    if (points_ instanceof Point) points = new Point[];
    if (points_ instanceof PVector) points = new PVector[];
    etc etc...
  }
  void sort() {
    <Sort function... (Accesses variable from points such as points[x].x)>
  }
}

Would that be the most efficent way to do it?