PrepZone Logo
PrepZone
Back to Java

Java · Easy

What are varargs in Java? What are the rules and pitfalls when using them?

JavaCore Java

Answer preview

Varargs allow a method to accept zero or more arguments of a specified type. Internally, they are passed as an array.…