【发布时间】:2013-08-30 19:12:47
【问题描述】:
我有一个带有字符串的 ArrayList 和一个可以接受任意数量的字符串作为参数的方法。
ArrayList<String> list = new ArrayList<String>();
// Filling the list with strings...
public addStrings(String... args) {
// Do something with those Strings
}
现在我想将这些字符串从我的数组列表传递给该方法。我怎样才能做到这一点?我如何称呼addStrings() 请注意,arraylist 中的字符串数量可能会有所不同。
【问题讨论】:
标签: android string arraylist variadic-functions