摘要: public class ArrayDemo07 { public static void main(String[] args) { int[] a = {2, 84, 12, 5748, 123, 51, 1}; int[] sort = sort(a); System.out.println( 阅读全文
posted @ 2022-03-28 16:31 白糖11 阅读(30) 评论(0) 推荐(0)
摘要: public class ArrayDemo08 { public static void main(String[] args) { //创建一个二维数组 11*11 0:没有棋子 1:黑棋 2:蓝棋 int[][] array1 = new int[11][11]; array1[1][2] = 阅读全文
posted @ 2022-03-28 16:31 白糖11 阅读(7) 评论(0) 推荐(0)
摘要: public class ArryDemo06 { public static void main(String[] args) { int[] a = {1,2,3,4,9999,3142,45,888,77}; System.out.println(a);//[I@1b6d3586对象输出不成功 阅读全文
posted @ 2022-03-28 16:30 白糖11 阅读(40) 评论(0) 推荐(0)
摘要: //多维数组 *了解public class ArrayDemo05 { public static void main(String[] args) { int[][] arry = {{1,2},{2,3},{3,4},{4,5}}; System.out.println(arry[0][1]) 阅读全文
posted @ 2022-03-28 16:28 白糖11 阅读(29) 评论(0) 推荐(0)
摘要: public class ArrayDemo03 { public static void main(String[] args) { int[] arrays ={1,2,3,4,5}; //打印全部的数组元素 for (int i= 0;i< arrays.length;i++){ System 阅读全文
posted @ 2022-03-28 16:24 白糖11 阅读(13) 评论(0) 推荐(0)
摘要: //三种初始化public class ArrayDemo02 { public static void main(String[] args) { //静态初始化:创建 + 赋值 int[] x = {1,2,3,4,5,6}; System.out.println(x[0]); //动态初始化 阅读全文
posted @ 2022-03-28 16:23 白糖11 阅读(34) 评论(0) 推荐(0)
摘要: public class ArrayDemo01 { public static void main(String[] args) { int[] nums;//声明一个数组 声明在栈里 nums = new int[10];//创建一个数组 创建在堆里 //声明创建数组可和一起写 int【】num 阅读全文
posted @ 2022-03-28 16:20 白糖11 阅读(61) 评论(0) 推荐(0)
摘要: public class Demo01 { //类修饰符 返回值 方法 public static void main(String[] args) { // 实际参数:实际调用传递给的参数 int sum = add(1, 2); System.out.println(sum); shuchu() 阅读全文
posted @ 2022-03-28 16:19 白糖11 阅读(38) 评论(0) 推荐(0)