Arbitrary Number of Arrays (Oracle tutorial)
<p>So I just learned about varargs on the Java Oracle tutorial, and I am having trouble reading this code. For example, what is "(Point... corners)" I know it is a shorten version of (Point[] corners) but what is "Point"? Is it an array that tells us about some (x,y) coordinate(s) that we define? Also, I do not understand what"(corners[1].x)" means. What is that dot notation ".x and .y", and what is exactly happening with the other "corners"? Sorry for all the questions, I know they may seem like a stupid questions, but I, nevertheless, thank you for your time. </p>

<pre><code>public Polygon polygonFrom(Point... corners) {
int numberOfSides = corners.length;
double squareOfSide1, lengthOfSide1;

// The "corners" array dot notations below are what confuse me the most. 
// There are values stored in each index correct?
//So "corner[1].x could contain element 6 right?

squareOfSide1 = (corners[1].x - corners[0].x)
                 * (corners[1].x - corners[0].x) 
                 + (corners[1].y - corners[0].y)
                 * (corners[1].y - corners[0].y);
lengthOfSide1 = Math.sqrt(squareOfSide1);

// more method body code follows that creates and returns a 
// polygon connecting the Points
</code></pre>

<p>}</p>