posted 23 years ago
If I could add something: The confusing thing about anonymous arrays (which is what we're talking about), is that at first glance it appears that an initialization list is the anonymous array: The confusing part (for me) was that I have a book that says The construct (ie: the anonymous array) returns an array reference which can be assigned, and passed as a parameter. In particular, the following two examples are equivalent:
int[] intArray = {2,3,4,5};
int[] intArray = new int[] {2,3,4,5};
I thought that {2,3,4,5} was an anonymous array, but of course it's not, it's simply an initialization list, and not the anonymous array itself. So this list by itself cannot be passed to a method which expects an array.