C
Chris Uppal
Just for academic interest (so far...):
Given this rather silly example:
void dumpEmAll(Object... all)
{
for (Object each : all)
System.out.println(each);
}
and given an array.
Object oneArray[] = //...
and a call similar to:
dumpEmAll(oneArray);
how do I make Java treat oneArray as the single parameter to dumpEmAll(), so
that the toString() method of Object[] will be called just once, rather than
having dumpEmAll() iterating over the elements of the array ?
The only ways I can think of are to mess with the -source flag to javac, or to
wrap oneArray in /another/ array. Both of which seem kinda clunky to me...
-- chris
Given this rather silly example:
void dumpEmAll(Object... all)
{
for (Object each : all)
System.out.println(each);
}
and given an array.
Object oneArray[] = //...
and a call similar to:
dumpEmAll(oneArray);
how do I make Java treat oneArray as the single parameter to dumpEmAll(), so
that the toString() method of Object[] will be called just once, rather than
having dumpEmAll() iterating over the elements of the array ?
The only ways I can think of are to mess with the -source flag to javac, or to
wrap oneArray in /another/ array. Both of which seem kinda clunky to me...
-- chris