I'm trying to initialize an array and insert some values into it in Java, but I get out of bounds exception. This is the code
int xPoints[] = new int[]{};
int i = 0;
for(Edge e : myVectorOfEdges){
xPoints[i] = e.start;
i++;
}
I must use this type of data structure, because I am working with polygons which accept only int[]
type.