摘要:
在函数中调用自身叫做递归。 public static int recursion(int n){ if(n==1 || n==2){ return 1; } return recursion(n-1)+recursion(n-2); } 这就是一个简单的调用自身的函数,输出第 n位 数列 1 1 阅读全文
posted @ 2016-06-06 00:36
闻溪山居
阅读(171)
评论(0)
推荐(0)
摘要:
在同一个类中出现多个同名函数,叫做方法重载。 重载的要求:参数列表不能相同(参数数量和类型不同) public static int getdays(int a,int b){} public static int getdays(int a,int b,int c){} public static 阅读全文
posted @ 2016-06-06 00:27
闻溪山居
阅读(95)
评论(0)
推荐(0)
浙公网安备 33010602011771号