静态方法怎么调用私有变量
public class cS {
private float screen;
public static float getScreen() {
cS cS3=new cS();
return cS3.screen;
}
public void setScreen(Float newScreen) {
screen=newScreen;
System.out.println(screen);
}
}
package canshu;
public class cS2 {
public static void main(String[]args) {
cS cs = new cS();
cs.setScreen(200f);
System.out.println(cs.getScreen());
}
}