title: Passing Array Constant to enum Constructor
body: <p>Java enum lets you pass arguments to the constructor, but I can't seem to pass an array.  For instance, the following code compiles with out error:</p>
  
  <pre><code>enum Color {
      RED(255,0,0),
      GREEN(0,255,0),
      BLUE(0,0,255);
  
      int[] rgb;
  
      Color(int r, int g, int b) {
          rgb[0] = r;
          rgb[1] = g;
          rgb[2] = b;
      }
  }
  </code></pre>
  
  <p>But if this same data is passed in as an array constant, the code will not compile:</p>
  
  <pre><code>enum Color {
      RED({255,0,0}),
      GREEN({0,255,0}),
      BLUE({0,0,255});
  
      int[] rgb;
  
      Color(int[] rgb) {
          this.rgb = rgb;
      }
  }
  </code></pre>
  
  <p>I have also tried variations of creating a new int[] array, like:</p>
  
  <pre><code>...
  RED(new int[]{255,0,0}),
  ...
  </code></pre>
  
  <p>with no luck.  I think the problem lies in passing an array constant.  I'm not sure if it is a simple syntax that needs to be corrected or if there is an underlying problem with passing this type of data.  Thanks in advance.</p>