摘要: 阅读全文
posted @ 2022-03-28 18:16 卿凌 阅读(10) 评论(0) 推荐(0)
摘要: package com.chenao.struct;public class TestDemo01 { public static void main(String[] args) { //打印三角形 5 行 for (int i = 1; i <= 5; i++) { //建立一个for循环语句, 阅读全文
posted @ 2022-02-23 09:27 卿凌 阅读(39) 评论(0) 推荐(0)
摘要: package com.chenao.struct;public class BreakDemo { public static void main(String[] args) { //break在任何循环语句的主题部分,均可用break控制循环的流程。 // break 用于强行退出循环,不执行 阅读全文
posted @ 2022-02-23 09:16 卿凌 阅读(28) 评论(0) 推荐(0)
摘要: package com.chenao.struct;public class ForDemo01 { public static void main(String[] args) { //for 循环语句是支持迭代的一种通用结构,是最有效、最灵活的循环结构 //for 循环执行的次数是在执行前就确定 阅读全文
posted @ 2022-02-23 09:12 卿凌 阅读(93) 评论(0) 推荐(0)
摘要: package com.chenao.struct;public class DoWhileDemo01 { public static void main(String[] args) { // while如果不满足条件,则不能进入循环,do...while循环至少会执行一次 /* 1.while 阅读全文
posted @ 2022-02-23 09:07 卿凌 阅读(150) 评论(0) 推荐(0)
摘要: package com.chenao.struct;public class WhileDemo01 { public static void main(String[] args) { /* 1.只要布尔表达式为 true,循环就会一直执行下去 2.我们大多数情况是会让程序停止下来的,我们需要一个 阅读全文
posted @ 2022-02-23 09:05 卿凌 阅读(149) 评论(0) 推荐(0)
摘要: package com.chenao.struct;public class SwitchDemo01 { public static void main(String[] args) { //case穿透 //switch 匹配一个具体的值 //if 匹配一个区间 char grade = 'A' 阅读全文
posted @ 2022-02-23 09:01 卿凌 阅读(27) 评论(0) 推荐(0)
摘要: package com.chenao.struct;import java.util.Scanner;public class IfDemo01 { public static void main(String[] args) { //if 单选择结构 Scanner scanner = new S 阅读全文
posted @ 2022-02-23 09:00 卿凌 阅读(31) 评论(0) 推荐(0)
摘要: package com.chenao.scanner;import java.util.Scanner;public class Demo01 { public static void main(String[] args) { //Scanner对象 //实现程序和人的交互 //可以通过Scann 阅读全文
posted @ 2022-02-21 20:03 卿凌 阅读(25) 评论(0) 推荐(0)
摘要: package operator; public class Demo01 { public static void main(String[] ages){ //二元运算符 //Ctrl+D 复制当前行到下一行 int a=10; int b=20; int c=30; int d=30; Sys 阅读全文
posted @ 2022-02-21 10:57 卿凌 阅读(27) 评论(0) 推荐(0)