What is the maximum of number of arguments for varargs in java?

倖福魔咒の 提交于 2019-12-18 03:10:32

问题


What is the maximum of number of arguments which can be used by a vararg in java ? I believe there should be some limit and it is not infinite.


回答1:


A method (including the static class initializer) can have at most 64k. If the arguments are such that they can be pushed with a single bytecode that is 1 byte long each, you can have something about 64000 arguments on a call.



来源:https://stackoverflow.com/questions/18164255/what-is-the-maximum-of-number-of-arguments-for-varargs-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!