Is it possible to pass a list of arguments to a method without declaring them beforehand?
<p>Given a method such as: </p>

<pre><code>public void blit(int[] pos) {
   do stuff..
}
</code></pre>

<p>Is there a way to pass in a list of arguments without first declaring them? </p>

<p>For instance, in Python, I could do something like:</p>

<pre><code>def blit(pos):
   stuf...

blit([20,50])
</code></pre>

<p>I can simply pass in a list that created specifically in the argument list. To do the equivalent in Java, it seems I have to first declare the array, and only then can I pass it to the method. </p>

<pre><code>int[] coordinates = {20,50};
blit(coordinates);
</code></pre>

<p>Which is not a huge deal, but it'd be handy if I could just do something like, </p>

<pre><code>blit({20,50});
</code></pre>

<p>But that, of course, doesn't work. I've also tried creating the array inside of the call like,</p>

<pre><code>blit(new int[] = {20,40});
</code></pre>

<p>But again, no luck. So, perhaps a terrible question, but is there a way to pass lists of arguments to a method that mimics in part the behavior of Python?  </p>
