摘要: import java.util.Scanner;// 导包 public class day2_2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in);//创建对象 System.out.pr 阅读全文
posted @ 2024-03-01 19:48 公子Learningcarer 阅读(2) 评论(0) 推荐(0) 编辑
摘要: public class day2_1 { public static void main(String[] args) { /* 三元运算符 格式:条件表达式 ? 表达式1 : 表达式2 执行流程: 如果条件表达式为true,那么执行表达式1; 如果条件表达式为false,那么执行表达式2; 注意 阅读全文
posted @ 2024-03-01 19:37 公子Learningcarer 阅读(2) 评论(0) 推荐(0) 编辑
摘要: //运算符 public class day2 { public static void main(String[] args) { int a = 3; int b = 2; // 加号运算符 System.out.println("a+b="+(a+b));// 代码计算括号的优先级高于字符串 阅读全文
posted @ 2024-03-01 18:11 公子Learningcarer 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2024-03-01 18:07 公子Learningcarer 阅读(2) 评论(0) 推荐(0) 编辑
摘要: java 变量 2大类4小类8小种 基本数据类型 整型 byte short int long 浮点型 float double 字符型 char 布尔型 boolean 引用数据类型 (未学) public class day1 { public static void main(String[] 阅读全文
posted @ 2024-03-01 15:21 公子Learningcarer 阅读(2) 评论(0) 推荐(0) 编辑