摘要: package com.Leo.array;public class ArrayDemo08 { public static void main(String[] args) { //1.创建一个二维数组 11* 11 0:没有棋子 1:黑棋 2:白棋 int[][] array1 = new in 阅读全文
posted @ 2021-06-10 08:48 Leoyuan 阅读(49) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;import java.util.Arrays;//冒泡排序//1. 比较数组中,两个相邻的元素,如果第一个数比第二个数大,我们就交换他们的位置//2. 每一次比较,都会产生一个最大,或者最小的数子;//3. 下一轮则可以少一次排序!//4. 依次循环,直 阅读全文
posted @ 2021-06-10 07:37 Leoyuan 阅读(54) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;import java.util.Arrays;public class ArrayDemo06 { public static void main(String[] args) { int [] a = {1,2,3,4,9090,31231,543,2 阅读全文
posted @ 2021-06-10 07:08 Leoyuan 阅读(44) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;public class ArrayDemo05 { public static void main(String[] args) { //[4][2] /* 1,2 array[0] 2,3 array[1] 3,4 array[2] 4,5 array 阅读全文
posted @ 2021-06-10 06:43 Leoyuan 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑