反射:调用构造方法【Constructor】
一个类的实例化还是需要调用它的构造函数的,这次我们利用反射来推理出类的构造方法以及利用构造函数来实例化对象
创造一个类:Apple
Apple
package javabase.entity;
import javabase.service.Grow;
import javabase.service.SunBathe;
public class Apple extends Fruit implements Grow,SunBathe {
private Integer weight;
//无参构造函数
public Apple(){
}
//有参构造函数
public Apple(Integer weight){
this.weight = weight;