title: Java Variable Length Parameter vs. Array, Simply Syntactic Sugar?
body: <p>I am taking a Data Structures and Algorithms course for fun at a local community college. The course's textbook is Y. Daniel  Liang's <em>Introduction to Java Programming, 10th Edition</em>. The book, itself, is pretty solid.</p>
  
  <p>In dealing with <code>Java.util.Arrays</code>, Liang mentions Java's "variable-length" parameter. He writes (p. 265):</p>
  
  <blockquote>
    <p>Java treats a variable-length parameter as an array. You can pass an
    array or a variable number of arguments to a variable-length
    parameter. When invoking a method with a variable number of arguments,
    Java creates an array and passes the arguments to it.</p>
  </blockquote>
  
  <p>An example being:</p>
  
  <pre><code>public static void (int... toes) {
      //... some code
  }
  </code></pre>
  
  <p>However, Liang never explains the origin or advantage of the variable-length parameter. If, as Liang says, the variable-length parameter is "converted" to an array, what is their advantage? Is there a software design pattern or engineering goal that is facilitated by the variable length parameter?</p>
  
  <p>In other words, what does the above code snippet offer that is not offered by the below:</p>
  
  <pre><code>public static void (int[] toes) { // ...
  </code></pre>