public class Testing {
static void calculate(Integer... i) {}
public static void main(String[] args) {
calculate(12);
}
}

What does the ... in the calculate method argument indicates?

Recommended Answers

All 2 Replies

it means that you can pass variable number of arguments (type int) to the calculate() method, like:

calculate(1); 
calculate(2, 5); 
calculate(4, 6 ,9);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.