|
Java SDK 1.5 (code named Tiger) is going to support variable length argument lists. In C#, this is accomplished via the params keyword. In Java, they are going to use an ellipsis token.
Keith Wedinger
,
Friday, June 06, 2003 6:07 AM
Not a bad thing. It's always good to have a choice. Considering what we've got in C# that was taken from Java, I don't think we should be spinning this as "yet another C# feature in Java".
anon,
Friday, June 06, 2003 6:43 AM
Actually, the "..." for variable length arguments comes from C++, not C#, (maybe C++ borrowed from something else too).
http://www.cs.unt.edu/~donr/courses/4010/NOTES/stdarg/
Jesse Ezell,
Friday, June 06, 2003 1:41 PM
I'm not quite clear on whether this was an ANSI C proposal propogated into C++, or a C++ feature back-propogated into C (like the whole function-declarations thing...)
The proposed Java syntax is a bit of a hybrid though: it insists that you declare 'Object[] args...' even though Object is the only valid type for it. I suppose you couldn't do what C/C++ do and only provide a library function for getting at your parameter array.
Mike Dimmick,
Friday, June 06, 2003 3:45 PM
Is it possible to ask for a variable length array of strings, a la "params string[]"?
anon,
Friday, June 06, 2003 8:10 PM
Slightly irreverant to what the Java people did so far.
Stephane Rodriguez,
Sunday, June 08, 2003 3:26 AM
Reply
to this news
Marquee de Sells
|