摘要: package com.Leo.array;public class ArrayDemo04 { public static void main(String[] args) { int[] arrays = {1,2,3,4,5};//// //JDK1.5 没有下标// for (int arr 阅读全文
posted @ 2021-06-09 23:55 Leoyuan 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-06-09 23:26 Leoyuan 阅读(77) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;public class ArrayDemo02 { public static void main(String[] args) { //静态初始化:创建 + 赋值 int[] a = {1,2,3,4,5,6,7,8}; System.out.prin 阅读全文
posted @ 2021-06-09 22:17 Leoyuan 阅读(44) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;public class ArrayDemo01 { //变量的类型 变量的名字 = 变量的值‘ //数组类型 public static void main(String[] args) { int[] nums;//1.声明一个数组 nums = ne 阅读全文
posted @ 2021-06-09 21:07 Leoyuan 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-06-09 20:50 Leoyuan 阅读(17) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.method;public class Demo05 { public static void main(String[] args) { Demo05 test = new Demo05(); test.test(); } public void test(){ t 阅读全文
posted @ 2021-06-09 20:44 Leoyuan 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
摘要: package com.Leo.struct;public class DoWhileDemo01 { public static void main(String[] args) { int i = 0; int sum = 0; do { sum += i; i++; }while (i<=10 阅读全文
posted @ 2021-06-09 09:24 Leoyuan 阅读(37) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;public class WhileDemo01 { public static void main(String[] args) { //输入0-100 int i = 0; while (i<100){ i++; System.out.println 阅读全文
posted @ 2021-06-09 09:11 Leoyuan 阅读(48) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.struct;public class SwitchDemo01 { public static void main(String[] args) { //case 穿透 //switch 匹配一个具体的值 char grade = 'B'; switch (grad 阅读全文
posted @ 2021-06-09 08:44 Leoyuan 阅读(40) 评论(0) 推荐(0) 编辑