public class Telphone {
private float screen;
private float cpu;
private float mem;
public float getScreen(){
return screen;
public void getScreen(float newScreen){
screen=newScreen;
}
}}
public class Telphone {
private float screen;
private float cpu;
private float mem;
public float getScreen(){
return screen;
public void setScreen(float newScreen){
screen=newScreen;
}
第一个方法少了个“}”。。。。。。(不知道你是不是要写两个方法?)
不要把有参数的public void getScreen(float newScreen)写在无参数函数的里面,把他写在无参数函数的外面就可以了