public class test12 {
public static void main(String[] args) {
//首先创建一个名为scores的对象
test12 scores = new test12();
//调用方法并且接收返回值,保存在变量score中
int score = scores.classSum();
System.out.println(“和为:”+score);
}
//定义无参带返回值的方法
public int classSum() {
int a = 2;
int b = 55;
int sum = a + b;
return sum;
}
}



