Brett McLaughlin and David Flanagan are working on Java 1.5 Tiger developers notebook.
They have offered up chapter 5, which is on the new varargs support.
As well as explaining the simple behind the scenes (e.g. the compiler makes String… == String[]), they also show you some of the work arounds.
Although varargs can be nice (especially for methods such as the new sprintf(”…”, …)) I do sometimes wish that we would have more innovative items to be excited about. In the past Sun was all about telling us that “you don’t NEED that” for various features, and now (thanks to C#) we are getting them.
I liked being able to have @_ in Perl to take in anything… and often had the input come in as a hash, which would enable a kinda named parameters:
ageCheck(name => ‘Bob’, age => ‘30′);
I always liked multiple lvalue’s too:
($x, $y) = ($y, $x);
Thanks for the new features, now lets get on to some really cool stuff in JDK 1.6 or whatever it will be numbered.
August 31st, 2006 at 11:22 pm
Interesting information.