参数类型中的这三个点是什么 [英] What are these three dots in parameter types

查看:63
本文介绍了参数类型中的这三个点是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

此方法签名的省略号是什么?

例如: protected void onProgressUpdate(Context ... values)

推荐答案

一个字: varargs


最终参数类型后的三个句点表示最终参数可以作为数组作为参数序列传递。 Varargs只能在 的最终参数位置使用。

The three periods after the final parameter's type indicate that the final argument may be passed as an array or as a sequence of arguments. Varargs can be used only in the final argument position.

这篇关于参数类型中的这三个点是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆