Java – Return a Point value in Java

javapointreturn

How do I return the value of a Point function.
Example:

public Point myFunction(int x, int y) {
    return ???; // Want to return X and Y as a point.
}

I have no idea how the return should look.
Help please.

Best Solution

Have you tried:

   public Point myFunction(int x, int y) {
        return new Point(x, y);
    }

What kind of point are you trying to make?