3 ms·
Java didn't support varargs until version 5, so it might have been a workaround for that particular deficiency.
by ptx 3y ago
Java didn't support varargs until version 5, so it might have been a workaround for that particular deficiency.
- ghosty141 3y agoReminds me of this "gem" in C#: https://learn.microsoft.com/en-us/dotnet/api/system.func-2?view=net-7.0 https://learn.microsoft.com/en-us/dotnet/api/system.func-2?v... You better not have more than 16 parameters with Func (which is kind of a good thing? Functions who take 16 parameters are pure evil).
- PaulHoule 3y agoIt is also a little faster to have a fixed number of parameters than to use varargs so it is not unusual for many libraries to have X(a) X(a, b) X(a, b, c) ... X(a, b, c, ..., ...rest) functions.
- Marazan 3y agoGood guess but it wasn't varargs, those were default value overrides IIRC. Thing that was objectionable it was that each an every argument was Object type. Absolutely no affordable whatsoever