Say I have a method such as:
public void printElements(int[] array)
How could I send an int[] as an argument without declaring it previously (so, actually create it inside the message). I want to avoid something like:
int[] anArray = { 5, 3, 10 };
Foo.printElements(anArray);
And use something (although this doesn't work) like this instead:
Foo.printElements( new int{ 5, 3, 10 } );