目前我所知道的有

1、通过Class对象的newInstance()方法,这种方法的局限是只能取调用默认的构造函数

2、通过取得Class对象的getConstructor方法取得Construtor对象,然后再通过调用Constructor类的newInstance的两个方法

3、通过Array.newInstance方法来创建对象,但这种只适用于数组,数组也是一种对象

相关文章:

  • 2022-12-23
  • 2022-02-12
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-21
  • 2021-12-17
  • 2021-10-14
  • 2021-12-09
  • 2021-12-06
相关资源
相似解决方案