|
Author |
Topic: array literal syntax (Read 258 times) |
|
kevinP
|
array literal syntax
« on: Jun 6th, 2004, 11:12pm » |
|
With a method signature such as this: PolarPolygon(int[] vertices, int[] sides, float _xPos, float _yPos) ...am I not allowed to call it like this: polyA = new PolarPolygon({ 0, 120, 240 }, { unit, unit, unit }, width/2, height/2); ? Error message is "Unexpected token: {" -K
|
Kevin Pfeiffer
|
|
|
TomC
|
Re: array literal syntax
« Reply #1 on: Jun 7th, 2004, 12:18am » |
|
You can do: Code: polyA = new PolarPolygon( new int[] { 0, 120, 240 }, new int[] { unit, unit, unit }, width/2, height/2); |
|
|
|
|
|
kevinP
|
Re: array literal syntax
« Reply #2 on: Jun 7th, 2004, 11:45am » |
|
Yes! And I even remember now seeing that in the Nutshell book. I was trying to do an anonymous array, but the wrong way. Thanks, -K
|
Kevin Pfeiffer
|
|
|
|