Categories
Certification Java Programming SCJP

Varargs, for those times when you’re not sure how many parameters you’ll have…

As of Java 5, methods are now able to accept from 0 to many arguments. Sounds confusing, but you could actually be using it already without knowing, how about looking at your main methods? As we can see above, var args are declared as TYPE… NAMEOFVARIABLE. Lets take a look at a basic example I’ve […]