static int score2 = 92;
public static int sum() {
return score1+score2;
}
public static void main(String[] args) {
int allScore = HelloWorld.sum();
System.out.println("总分:" + allScore);
}
public static int sum() {
return score1+score2;
}
public static void main(String[] args) {
int allScore = HelloWorld.sum();
System.out.println("总分:" + allScore);
}
2015-04-01
static int score2 = 92;
return score1+score2;
HelloWorld.sum();
// 调用静态方法sum并接收返回值
int allScore = HelloWorld.sum();
return score1+score2;
HelloWorld.sum();
// 调用静态方法sum并接收返回值
int allScore = HelloWorld.sum();
2015-04-01