两个数求和的代码
package com.xiaoa;/**
* @author niyite
*
*/
/*
* 需求:两个数求和
* */
public class AddTest {
public static void main(String[] args){
int a = add(3,5);
System.out.println(a);
System.out.println(add(3,5));
}
//add函数,用来两个数求和
public static int add(int x, int y){
int sum = x+y;
return sum;
}
}