August 2004
Intermediate to advanced
480 pages
9h 41m
English
Varargs. Yes, that is what passes for a word these days (did you ever read Ray Bradbury's “The Sound of Thunder”?). The vararg is a thing that they have in C# and other languages and it means that you stomp your foot and say, “This method has a bunch of parameters and I just don't know how many parameters a client might want to pass it, all right?” It means “variable length argument list.”
This is an easy concept to start working with. The following class defines a method that accepts a vararg, and invokes the same method passing it first several arguments and then fewer arguments. The arguments come in as an array.
package net.javagarage.varargs; /* Demos how to use variable length argument lists. ...
Read now
Unlock full access