摘要: Break package com.tian.struct; public class BreakDemo { public static void main(String[] args) { int i = 0; while (i<100){ i++; System.out.println(i); 阅读全文
posted @ 2025-07-13 13:20 A那就算了吧 阅读(15) 评论(0) 推荐(0)
摘要: For循环 For和While的对比 package com.tian.struct; public class ForDemo01 { public static void main(String[] args) { int a = 1;//初始化条件 while(a<=100){//条件判断 S 阅读全文
posted @ 2025-07-13 13:19 A那就算了吧 阅读(28) 评论(0) 推荐(0)
摘要: While循环 package com.tian.struct; public class WhileDemo01 { public static void main(String[] args) { //输出1-100 int i = 0; while (i<100){ i++; System.o 阅读全文
posted @ 2025-07-13 13:18 A那就算了吧 阅读(8) 评论(0) 推荐(0)
摘要: Switch 选择结构 package com.tian.struct; public class SwitchDemo01 { public static void main(String[] args) { //case 穿透 //switch 匹配一个具体的值 char grade = 'C' 阅读全文
posted @ 2025-07-12 13:01 A那就算了吧 阅读(6) 评论(0) 推荐(0)
摘要: 顺序结构 package com.tian.struct; public class ShuXuDemo { public static void main(String[] args) { System.out.println("hello1"); System.out.println("hell 阅读全文
posted @ 2025-07-12 13:00 A那就算了吧 阅读(5) 评论(0) 推荐(0)
摘要: Scanner用法 Scanner next package com.tian.scanner; //Scanner next import java.util.Scanner; public class Demo01 { public static void main(String[] args) 阅读全文
posted @ 2025-07-12 13:00 A那就算了吧 阅读(7) 评论(0) 推荐(0)
摘要: JavaDoc生成文档 package com.tian.base; /** * @author Kuangshen * @version 1.0 * @since 1.8 */ public class Doc { String name; /** * @author Kuangshen * @p 阅读全文
posted @ 2025-07-11 11:27 A那就算了吧 阅读(5) 评论(0) 推荐(0)
摘要: 二元运算符 +-*/ package com.tian.operator; public class Demo01 { public static void main(String[] args) { //二元运算符 //Ctrl + D :复制当前一行到下一行 int a = 10; int b 阅读全文
posted @ 2025-07-11 11:26 A那就算了吧 阅读(8) 评论(0) 推荐(0)
摘要: 变量 作用域 常量 public class Dome06 { public static void main(String[] args) { //int a,b,c; //int a=1,b=2,c=3;(可在一行,但不建议,尽量多行去写) //定义变量 int a = 1; int b = 2 阅读全文
posted @ 2025-07-10 14:47 A那就算了吧 阅读(11) 评论(0) 推荐(0)
摘要: 类型转换 public class Demo04 { public static void main(String[] args) { int i =128; byte b = (byte)i;//内存溢出 //强制转换 (类型)变量名 高--低 //自动转换 低--高 System.out.pri 阅读全文
posted @ 2025-07-10 14:46 A那就算了吧 阅读(5) 评论(0) 推荐(0)