class Test {
public Test(String s) {
}}Test.class.getConstructors()[0].newInstance(null) 这样的写法是会出错的。因为传递null 表示无参数构造函数。但我有一个参数,而我需要用null传递进去该怎么办呢?
public Test(String s) {
}}Test.class.getConstructors()[0].newInstance(null) 这样的写法是会出错的。因为传递null 表示无参数构造函数。但我有一个参数,而我需要用null传递进去该怎么办呢?
public Test(){
}构造函数 ;
否则 就无所谓啦
eg:void test(String arg1,int arg2)>>>void test(Dto dto);
Dto(){
String arg1;
int arg2;
}