我这样对吗?为什么?
public class UseStatic {
static int score1 = 86;
static int score2 = 92;
public static void sum(){
System.out.println(score1+score2);
}
}
public class UstTest {
public static void main(String[] args) {
UseStatic u = new UseStatic();
u.sum();
}
}
如果错了,为什么?谢谢!!