2022年7月23日
摘要:
1 package method; 2 3 public class Demo02 { 4 public static void main(String[] args) { 5 int max = max(20, 10); 6 System.out.println(max); 7 } 8 //比大小
阅读全文
posted @ 2022-07-23 08:58
一枚努力学习的小白
阅读(23)
推荐(0)
摘要:
1 package method; 2 3 public class Demo02 { 4 public static void main(String[] args) { 5 double max = max(20, 10); 6 System.out.println(max); 7 } 8 //
阅读全文
posted @ 2022-07-23 08:58
一枚努力学习的小白
阅读(24)
推荐(0)
2022年7月21日
摘要:
流程控制练习: 1 package struct; 2 3 public class TestDemo { 4 public static void main(String[] args) { 5 //打印三角形 5行 6 for (int i = 0; i <= 5 ; i++) { 7 for
阅读全文
posted @ 2022-07-21 16:32
一枚努力学习的小白
阅读(16)
推荐(1)
摘要:
1 package struct; 2 3 public class BreakDemo { 4 public static void main(String[] args) { 5 int i = 0 ; 6 while(i<100){ 7 i++; 8 System.out.println(i)
阅读全文
posted @ 2022-07-21 16:29
一枚努力学习的小白
阅读(20)
推荐(1)
摘要:
1 package struct; 2 3 public class ForDemo05 { 4 public static void main(String[] args) { 5 int[] numbers = {10,20,30,40,50};//定义一个数组 6 for (int i = 0
阅读全文
posted @ 2022-07-21 16:27
一枚努力学习的小白
阅读(22)
推荐(0)
摘要:
① 1 package struct; 2 3 public class ForDemo04 { 4 public static void main(String[] args) { 5 /* 6 1 * 1 = 1 7 1 * 2 = 2 2 * 2 = 4 8 1 * 3 = 3 2 * 3 =
阅读全文
posted @ 2022-07-21 16:26
一枚努力学习的小白
阅读(65)
推荐(1)
摘要:
1 package struct; 2 3 public class ForDemo01 { 4 public static void main(String[] args) { 5 int a = 1;//初始化条件 6 while(a<=100){//条件判断 7 System.out.prin
阅读全文
posted @ 2022-07-21 16:25
一枚努力学习的小白
阅读(338)
推荐(1)
摘要:
1 package struct; 2 3 public class DoWhileDemo01 { 4 public static void main(String[] args) { 5 int i = 0; 6 int sum = 0; 7 do { 8 sum = sum + i; 9 i+
阅读全文
posted @ 2022-07-21 16:24
一枚努力学习的小白
阅读(29)
推荐(1)
摘要:
1 package struct; 2 3 public class WhileDemo01 { 4 public static void main(String[] args) { 5 int i = 0; 6 while(i<100){ 7 i++; 8 System.out.println(i
阅读全文
posted @ 2022-07-21 16:23
一枚努力学习的小白
阅读(61)
推荐(1)
2022年7月18日
摘要:
1 package struct; 2 3 public class SwitchDemo01 { 4 public static void main(String[] args) { 5 //case穿透 6 char grade = 'C'; 7 8 switch(grade){ 9 case
阅读全文
posted @ 2022-07-18 17:04
一枚努力学习的小白
阅读(21)
推荐(1)