错误信息:

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)


解决方法:

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

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

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

相关文章:

  • 2021-08-01
  • 2022-12-23
  • 2021-05-02
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案