I cannot seem to understand the concept of variable length argument lists. When I do a bit of research, it makes sense, but I can't figure out this question to save my life.
What is the result of the following call?
get(1, 2, 3, 4, 5, 6, 7); // The Call
public int get(int ... a) {
return a[2];
}
My answer was "2" which is the only thing that makes sense to me. The other options were 1, 3, or 4. Thanks for your time.
Arrays are zero based. Which is to say the first item is at position 0, the second at position 1. So the item at position 2 in your case is the integer 3.