摘要: 包装类Wrapper 此系列笔记来源于 BiliBili韩顺平老师的Java基础课 八种基本数据类型分别对应一种包装类,可以调用类的方法 装箱 and 拆箱 jdk5前是手动装箱和拆箱: //int 和 Integer 的装箱和拆箱 int n = 100; //手动装箱(两种) Integer i 阅读全文
posted @ 2022-04-11 19:31 Yra 阅读(48) 评论(0) 推荐(0)
摘要: BigInteger和BigDecimal类 此系列笔记来源于 BiliBili韩顺平老师的Java基础课 介绍: BigInteger适合保存比较大的整型 BigDecimal适合保存精度更高的浮点型 BigInteger BigInteger运算时需要用对应的方法,不能直接 + - * / Bi 阅读全文
posted @ 2022-04-11 12:51 Yra 阅读(28) 评论(0) 推荐(0)
摘要: System类 此系列笔记来源于 BiliBili韩顺平老师的Java基础课 常用方法 1、System.exit(0); 退出当前程序 2、System.arraycopy() 数组拷贝 int src[] = {1, 2, 3}; int dest[] = new int[3]; System. 阅读全文
posted @ 2022-04-11 12:27 Yra 阅读(28) 评论(0) 推荐(0)
摘要: Arrays类 常用方法 1、Arrays.toString() 返回数组的字符串形式 2、Arrays.sort() 排序 Arrays.sort(arr, new Comparator() { public in compare(Object o1, Object o2) { Integer i 阅读全文
posted @ 2022-04-11 12:10 Yra 阅读(32) 评论(0) 推荐(0)