摘要: SWITCH case switch 语句中的变量类型可以是: byte、short、int 或者 char。从 Java SE 7 开始,switch 支持字符串 String 类型了,同时 case 标签必须为字符串常量或字面量。 当变量的值与 case 语句的值相等时,那么 case 语句之后 阅读全文
posted @ 2023-11-23 15:10 liontm 阅读(99) 评论(0) 推荐(0)
摘要: Java中有三种主要的循环结构: while 循环 do…while 循环 for 循环(还有一种增强的for循环) 阅读全文
posted @ 2023-11-23 11:59 liontm 阅读(23) 评论(0) 推荐(0)
摘要: 算术运算符 需要注意的是a++和++a的区别。 int d = 25; // 查看 d++ 与 ++d 的不同 System.out.println("d++ = " + (d++) ); System.out.println("++d = " + (++d) ); 其中d++ = 25,++d = 阅读全文
posted @ 2023-11-23 11:07 liontm 阅读(33) 评论(0) 推荐(0)