加法小计算

public class Cal {
//定义一个方法,可以计算两个数的和
    int add(int a,int b){
public class Test {

    public static void main(String[] args) {
Cal c=new Cal();

//int sum=c.add(89, 99);


System.out.println(c.add(15, 30));        
        
        
    }
    }

 

int sum=a+b;
        return sum;
    }
}

 

posted @ 2017-04-04 21:26  苏轼的红烧肉  阅读(91)  评论(0编辑  收藏  举报