当你使用 object... 作为参数时,它叫什么? [英] What is it called when you use object... as a parameter?

查看:23
本文介绍了当你使用 object... 作为参数时,它叫什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在 Java 中你可以有一个带有对象的函数......作为参数,然后方法将接受任意数量的对象作为参数并将其视为数组.这个叫什么?我一直在尝试搜索它,但似乎……被搜索引擎忽略了.我似乎记得 C 中的 printf 做同样的事情.

I have noticed in Java that you can have a function with object... as a parameter and then method will take any number of objects as a parameter and treat it as an array. What is this called? I have been trying to search for it but it seems ... is ignored by search engines. I seem to remember printf in C does the same thing.

谢谢.

推荐答案

它叫做 可变参数

这篇关于当你使用 object... 作为参数时,它叫什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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