package project1_9;
public class HelloWorld {
// 定义静态变量score1
static int score1 = 86;
//定义动态变量score2//
int score2 = 92;
HelloWorld scoreSum = new HelloWorld();
//定义静态变量sum,并且求和,score2通过对象定义的静态变量求和
static int sum =score1+scoreSum.score2;
public static void main(String[] args) {
System.out.println("总分:" + sum);
}
}
一条小咸鱼
相关分类