摘要: package com.Leo.method;public class Demo04 { public static void main(String[] args) { //调用可变参数的方法 printMax(34, 3, 3, 2, 56.5); printMax(new double[]{1 阅读全文
posted @ 2021-06-09 20:26 Leoyuan 阅读(39) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.method;public class Demo03 { public static void main(String[] args) { //args.Length 数组长度 for (int i = 0; i < args.length;i++){ System. 阅读全文
posted @ 2021-06-09 20:13 Leoyuan 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-06-09 19:55 Leoyuan 阅读(14) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.method;public class Demo02 { public static void main(String[] args) { int max = max(10, 20); System.out.println(max); } //比大小 public s 阅读全文
posted @ 2021-06-09 19:43 Leoyuan 阅读(56) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.method;public class Demo01 { //main 方法 public static void main(String[] args) { //int sum = add(1,2); //System.out.println(sum); test( 阅读全文
posted @ 2021-06-09 19:03 Leoyuan 阅读(41) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;public class TestDemo { public static void main(String[] args) { //打印三角形 5行 for (int i = 1; i <= 5; i++) { for (int j = 5; j >= 阅读全文
posted @ 2021-06-09 18:38 Leoyuan 阅读(43) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;public class BreakDemo { public static void main(String[] args) { int i = 0; while (i<100){ i++; System.out.println(i); if (i== 阅读全文
posted @ 2021-06-09 17:33 Leoyuan 阅读(40) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;public class ForDemo05 { public static void main(String[] args) { int[] numbers = {10,20,30,40,50};//定义一个数组 for (int i = 0; i < 阅读全文
posted @ 2021-06-09 17:03 Leoyuan 阅读(45) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;/*1*1=12*1=2 2*2=43*1=3 3*2=6 3*3=94*1=4 4*2=8 4*3=12 4*4=165*1=5 5*2=10 5*3=15 5*4=20 5*5=256*1=6 6*2=12 6*3=18 6*4=24 6*5=30 阅读全文
posted @ 2021-06-09 13:39 Leoyuan 阅读(43) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;public class ForDemo01 { public static void main(String[] args) { int a = 1;//初始化条件 while (a<=100){//条件判断 System.out.println(a) 阅读全文
posted @ 2021-06-09 13:24 Leoyuan 阅读(88) 评论(0) 推荐(0) 编辑