2025年11月5日
摘要: 增强型for循环以及 break和continue的作用 增强型for循环 package com.kun.struct; public class ForDemo05 { public static void main(String[] args) { int[] numbers = {10, 2 阅读全文
posted @ 2025-11-05 16:36 Sea(kun) 阅读(9) 评论(0) 推荐(0)
摘要: For循环和While循环练习 计算0到100之间的奇数和偶数的和 While package com.kun.struct; public class WhileDemo05 { public static void main(String[] args) { int i = 0; // 初始化变 阅读全文
posted @ 2025-11-05 12:19 Sea(kun) 阅读(8) 评论(0) 推荐(0)
摘要: 结构(2)If语句和For循环 If语句 package com.kun.struct; import java.util.Scanner; public class IfDemo01 { public static void main(String[] args) { Scanner scanne 阅读全文
posted @ 2025-11-05 11:53 Sea(kun) 阅读(5) 评论(0) 推荐(0)
摘要: 结构(1)While和DoWhile While package com.kun.struct; public class WhileDemo01 { public static void main(String[] args) { // 输出1到100 int i = 0; // 初始化变量i为0 阅读全文
posted @ 2025-11-05 11:46 Sea(kun) 阅读(5) 评论(0) 推荐(0)
  2025年10月22日
摘要: 数据类型,二元运算符,自动类型提升规则,关系运算,取余模运算 package com.kun.operator; public class Demo1 { public static void main(String[] args) { //八大基本数据类型 //整数 int unm1 =10;// 阅读全文
posted @ 2025-10-22 14:05 Sea(kun) 阅读(7) 评论(0) 推荐(0)
摘要: 自增自减,幂运算,逻辑运算符、短路运算,位运算,字符串连接符,三元运算符复习 package com.kun.base; public class Demo02 { public static void main(String[] args) { int a = 5; int b = a--;//执 阅读全文
posted @ 2025-10-22 08:32 Sea(kun) 阅读(5) 评论(0) 推荐(0)
  2025年10月21日
摘要: byte, short, int, Long, char数据类型复习 package com.kun.base; /** byte的取值范围:-128~127(-2的7次方到2的7次方-1) short的取值范围:-32768~32767(-2的15次方到2的15次方-1) int的取值范围:-21 阅读全文
posted @ 2025-10-21 17:23 Sea(kun) 阅读(12) 评论(0) 推荐(0)
摘要: scanner next方法 package scanner; import java.util.Scanner; public class Demo01 { public static void main(String[] args) { //创建一个扫描器对象,用于接收键盘数据 //引用局部变量 阅读全文
posted @ 2025-10-21 15:36 Sea(kun) 阅读(6) 评论(0) 推荐(0)
  2025年10月20日
摘要: 逻辑运算符 package operator; //逻辑运算符 public class Demo05 { public static void main(String[] args) { // 与 (and) 或 (or) 非 (取反) boolean a = true; boolean b = 阅读全文
posted @ 2025-10-20 11:27 Sea(kun) 阅读(3) 评论(0) 推荐(0)
  2025年10月19日
摘要: 运算符与自增自减 package operator; public class Demo01 { public static void main(String[] args) { //二元运算符 //Ctrl + D :复制当前行到下一行 int a = 10; int b = 20; int c 阅读全文
posted @ 2025-10-19 18:25 Sea(kun) 阅读(5) 评论(0) 推荐(0)