gpt4 book ai didi

java - 如何获得 'String...' 包装器?

转载 作者:行者123 更新时间:2023-11-30 06:55:13 24 4
gpt4 key购买 nike

我想通过'Class.getConstructor'获取A的构造函数。

A级

public class A {
public A(String... param) {
}
}

Class.getConstructor

public Constructor<T> getConstructor(Class... parameterTypes) throws NoSuchMethodException, SecurityException {
...
}

如何获得String...包装器?

最佳答案

String... 是字符串数组的语法糖。

就反射而言,它只是String[]

关于java - 如何获得 'String...' 包装器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41971370/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com