3 Feb 2005 08:15
Re: Array Initialization
Array initialisation is working fine in Classic Groovy AFAIK as its
unambiguous, it is preceeded by 'new <type>[] {....}'
Its currently not quite working in New Groovy, but its close :)
James
Mansour Raad wrote:
> Is the following accepted as an array Initializer or a closure ?
>
> myArray = new MyClass[] { new MyClass(foo:"bar") }
>
> I would think that I would need to rewrite it as:
>
> myArray = new MyClass[1]
> myArray[0] = new MyClass(foo:"bar")
>
> Another java/groovy gotcha ?
>
> Mansour
>
>
>
RSS Feed