Exception in thread "main" java.lang.IllegalArgumentException: wrong number of arguments...

错误信息:

com.反射.Student
Exception in thread "main" java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)

at com.反射.Test4.main(Test4.java:23)


解决方法:

自定义的类里面只能有一个构造函数



猜你喜欢

转载自blog.csdn.net/qq_35136982/article/details/80784186