摘要: Java的递归 public class Demo17 { public static void main(String[] args) { //阶乘的计算 System.out.println(f(10)); } public static int f(int a){ if (a==1){ ret 阅读全文
posted @ 2021-03-07 16:06 默默努力的路人甲 阅读(27) 评论(0) 推荐(0)
摘要: Java的可变参数 public class Demo16 { public static void main(String[] args) { Demo16 demo16 = new Demo16();//调用与实例变量调用一样 //因为test没有static所以不能直接调用 demo16.te 阅读全文
posted @ 2021-03-07 10:11 默默努力的路人甲 阅读(25) 评论(0) 推荐(0)
摘要: Java方法的重载 方法重载:在类中方法名称相同,但是形式参数不同 public class Demo15 { public static void main(String[] args) { int sum= max(30,30); System.out.println(sum); double 阅读全文
posted @ 2021-03-07 08:54 默默努力的路人甲 阅读(98) 评论(0) 推荐(0)