Varargs allow a method to accept zero or multiple arguments.
Source Code
public static void printNumbers(int... numbers) {
for (int number : numbers) {
System.out.println(number);
}
}
public static void main(String[] args) {
printNumbers(1, 2, 3, 4, 5);
}