public void foo(Integer... ids) {
Integer... fIds = bar(ids);
}
public void bar(Integer... ids) {
// I would like to eliminate few ids and return a subset. How should I declare the return argument
}
How should I declare the return type for bar?
You can refer to vararg parameters as an array.
See varargs docs
To the jvm this is actually an array, and the compiler has hidden the creation of the array.