摘要: 数组应用 1.应用 package com.array.Array; import java.util.Arrays; //Array类的应用 public class ArrayDemo07 { public static void main(String[] args) { int[] a = 阅读全文
posted @ 2021-06-03 16:29 颂溪庄 阅读(66) 评论(0) 推荐(0)
摘要: 二维数组 package com.array.Array; //二维数组 public class ArrayDemo05 { public static void main(String[] args) { //四行两列 /** * 1,2 array[0] * 2,3 array[1] * 3, 阅读全文
posted @ 2021-06-03 16:27 颂溪庄 阅读(42) 评论(0) 推荐(0)
摘要: 使用数组 package com.array; //使用数组 public class ArrayDemo03 { public static void main(String[] args) { int[] arrays = {1,2,3,4,5}; //1.打印全部数组元素 for (int i 阅读全文
posted @ 2021-06-03 16:25 颂溪庄 阅读(42) 评论(0) 推荐(0)
摘要: 初识数组 1.认识数组 package com.array; //初识数组 public class ArrayDemo01 { //变量类型 变量名字 = 变量的值 //数组类型 public static void main(String[] args) { int[] nums;//1.声明一 阅读全文
posted @ 2021-06-03 16:23 颂溪庄 阅读(50) 评论(0) 推荐(0)
摘要: 方法 package com.method; public class Demo01 { //main方法 public static void main(String[] args) { int sum = add(1,2); System.out.println(sum); } //加法 pub 阅读全文
posted @ 2021-06-03 08:33 颂溪庄 阅读(25) 评论(0) 推荐(0)
摘要: 画三角形 package com.struct; public class TextDemo01 { public static void main(String[] args) { //打印三角形 for (int i = 1;i <= 5;i++){ for (int j = 5;j>=i;j- 阅读全文
posted @ 2021-06-01 23:44 颂溪庄 阅读(144) 评论(0) 推荐(0)
摘要: continue package com.struct; public class ContinueDemo01 { public static void main(String[] args) { int i = 0; while (i<100){ i++; if (i%10==0){ Syste 阅读全文
posted @ 2021-06-01 23:42 颂溪庄 阅读(68) 评论(0) 推荐(0)
摘要: break package com.struct; public class BreakDemo01 { public static void main(String[] args) { int i = 0; while (i<100){ i++; System.out.println(i); if 阅读全文
posted @ 2021-06-01 23:40 颂溪庄 阅读(41) 评论(0) 推荐(0)
摘要: switch结构 package com.struct; public class SwitchDemo01 { public static void main(String[] args) { char grade = 'C'; //switch 匹配一个具体的值 switch (grade){ 阅读全文
posted @ 2021-06-01 23:38 颂溪庄 阅读(93) 评论(0) 推荐(0)
摘要: for结构 package com.struct; ​ public class FoDemo01 { public static void main(String[] args) { int a = 1;//初始化条件 ​ while (a<=100){ System.out.println(a) 阅读全文
posted @ 2021-06-01 23:35 颂溪庄 阅读(92) 评论(0) 推荐(0)