title: How to use array correctly
body: <p>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</p>
  
  <pre><code>int xPoints[] = new int[]{};
  int i = 0;
  for(Edge e : myVectorOfEdges){
      xPoints[i] = e.start;
      i++;
  
  }
  </code></pre>
  
  <p>I must use this type of data structure, because I am working with polygons which accept only <code>int[]</code> type.</p>