10 2021 档案

摘要:向上转型 Person 父类 Student 子类 Student student = new Student() Person p1 = student ok Object o1 = student ok Object o2 = student ok 向下转型 Person p = new Stu 阅读全文
posted @ 2021-10-26 15:36 流樱。 阅读(35) 评论(0) 推荐(0)
摘要:public class Main { public static void main(String[] args) { double d = 3.1415926; System.out.printf("%.2f\n", d); // 显示两位小数3.14 System.out.printf("%. 阅读全文
posted @ 2021-10-18 17:31 流樱。 阅读(263) 评论(0) 推荐(0)
摘要:\" 表示字符" \' 表示字符' \\ 表示字符\ \n 表示换行符 \r 表示回车符 \t 表示Tab \u#### 表示一个Unicode编码的字符 String s = "ABC\n\u4e2d\u6587"; // 包含6个字符: A, B, C, 换行符, 中, 文 阅读全文
posted @ 2021-10-18 17:01 流樱。 阅读(455) 评论(0) 推荐(0)
摘要:整数型: byte short int long 浮点型: float double 字符类型: char 布尔类型: boolean 引用数据类型(字符串): String 阅读全文
posted @ 2021-10-18 16:43 流樱。 阅读(103) 评论(0) 推荐(0)