// 定义静态变量score2
static int score2 = 92;
// 定义静态方法sum,计算成绩总分,并返回总分
public static int sum() {
int sum=score1+score2;
return sum;
}
public static void main(String[] args) {
int allScore = sum();
static int score2 = 92;
// 定义静态方法sum,计算成绩总分,并返回总分
public static int sum() {
int sum=score1+score2;
return sum;
}
public static void main(String[] args) {
int allScore = sum();
2018-10-25