public class HelloWorld{
public static void main(String[] args) {
int a=12;
int b=24;
int sun=a+b;
System.out.println("两数之和为:"+sum);
}
System.out.println("两数之和为:"+sum);-----亲,你上面定义的是sun,下面用的是sum。。。要细心哦