I\'m implementing an API an have a method which you pass a list of paths where the program reads resources from
public void importFrom(String... paths) {
}
Since varargs arguments get compiled into a single array argument you could generally prefer varargs since this might be more convinient in some cases and still allows to pass an array in other cases.
public void importFrom(String... paths)
{
}
compiles into
public void importFrom(String[] paths)
{
}
Alternatively you could also use Iterable to make it easier to pass the arguments as collection.