I have 2 arrays namely x
and y
and I wish to convert them into one Point
array.
This is what I've tried, but it doesn't seem to be working.
public class Point {
public static void main(String[] args) throws Exception {
Point[] objectPoints;
double x[] = {3,4,5};
double y[] = {4,5,6};
for (int i = 0;i < 2; i++) {
objectPoints[i] = new Point(x[i],y[i]);
}
}
}
How do I achieve that?