What does this kind of variable mean in Android ? (URL... urls,Integer... progress)
From here : http://developer.android.com/reference/android/os/A开发者_运维知识库syncTask.html
doInBackground(URL... urls)
onProgressUpdate(Integer... progress)
Are they a set of URL type named urls and a set of Integer type named progress ?
It's not Android specific, it's Java varargs. Simply speaking they are like URL[]
and Integer[]
They are called Varargs
.. they are kind of Arrays you can say but not exactly Arrays.. They hold multiple values of respective types(in your case URL and Integer ).. and you can access them just like Arrays using index..., like urls[0]
.. etc.. and while calling those methods just pass multiple arguments with comma separator..
精彩评论