有一个错误不知道怎么改了,求大神帮助
//这是我的定义的类
package com.imooc;
public class FangFa {
private float screen;
private float cpu;
private float mem;
public float getScreen(){
return screen;
}
public void setScreen(float newScreen){
screen=newScreen;
}
public FangFa(){
System.out.println("无参的构造方法执行了!");
}
public FangFa(float newScreen,float newCpu,float newMem){
screen=newScreen;
cpu=newCpu;
mem=newMem;
System.out.println("有参的构造方法执行了!");
}
}
//这是主函数
package com.imooc;
public class FZ {
public static void main(String[] args) {
// TODO Auto-generated method stub
FangFa hello=new FangFa();
FangFa hi=new FangFa(5.0f,1f,2.0f);
}
hi.setScreen(6.0f);
System.out.println("screen:"+hi.getScreen());
}
然后有一个错误不知道怎么改了