Table Oriented Programming IDE Feature: Show me a pared down view of staticly typed code
Aug 06

Varargs: Java is finally giving some conveniences

Tech Add comments

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.

One Response to “Varargs: Java is finally giving some conveniences”

  1. buy avandia Says:

    Interesting information.

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What is the number before 3? (just put in the digit)