public class ReflectPoint {
private int x;
public int y;
public ReflectPoint(int x, int y) {
super();
this.x = x;
this.y = y;
}
}
ReflectPoint pt1=new ReflectPoint(3,5);
Field fieldY=pt1.getClass().getField("y");//这里为什么提示有错误。
错误为:
类型不匹配:不能从 Field 转换为
DateFormat.Field |