package Day;
//函数的重载
//同一个类中,同名不同参
//定义一个加法运算 获取两个整数的和
//当定义的功能相同时 但参与的运算的未知内容不同 那么 这时就定义一个函数名称以表示其功能 方便阅读
//而通过参数列表的不同来区分多个同名函数 这就是重载
public class Day4a {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
add(4,5);
add(4,5,6);
print99(4);//如果传参的话结果不同
System.out.println("-----");
print99();
}
//两个数的和
public static int add(int x,int y)
{
return x+y;
}
//三个数的和
public static int add(int x,int y,int z)
{
return x+y+z;
}
//因为他们功能一致 所以名字一样 故同名不同参
public static void print99()
{
// for(int x=1;x<=9;x++)
// {
// for(int y=1;y