上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 97 下一页
摘要: 1、最常用 类.class 2、最实用(结合Properties) a、在模块文件夹下,新建目录(resources),标记为资源根目录->新建资源包(pro.properties)->输入className=全限类名(包名,类名) className=com.wt.reflect.Person b 阅读全文
posted @ 2025-04-21 20:58 市丸银 阅读(19) 评论(0) 推荐(0)
摘要: 1、注意 @Test注解,方法不能有返回值,不能有参数,不能修饰static 2、使用 a、单独建一个类用来做测试 b、案例 功能类 package com.wt.unit; public class CountValue { public int add(int a, int b){ return 阅读全文
posted @ 2025-04-21 19:26 市丸银 阅读(8) 评论(0) 推荐(0)
摘要: 一、获取 1、针对Collection // Stream<E> stream = collection对象.stream(); // list是 collection对象, 是 ArrayList<Person>对象 Stream<Person> stream = list.stream(); 2 阅读全文
posted @ 2025-04-20 22:08 市丸银 阅读(10) 评论(0) 推荐(0)
摘要: 一、步骤 1、观察是否是函数式接口(接口只有一个抽象类 接口可以被 @FunctionalInterface 注解)做方法参数传递 2、如果是,用Lambda表达式 3、调用方法,以匿名内部类的形式传递参数 4、从new接口到重写方法的方法名,删除,在删除一个大括号 5、在重写方法的参数后面加上-> 阅读全文
posted @ 2025-04-20 21:43 市丸银 阅读(6) 评论(0) 推荐(0)
摘要: 一、ObjectOutputStream 对象存储到硬盘 1、构造 new ObjectOutputStream(FileOutputStream对象) 2、方法 writeObject(对象) 3、注意 对象类需要实现 Serializable 二、ObjectInputStream 读取硬盘的对 阅读全文
posted @ 2025-04-20 14:49 市丸银 阅读(7) 评论(0) 推荐(0)
摘要: 1、创建 xx.properties文件 2、创建 FileInputStream对象 3、创建Properties对象 4、properties加载FileinputStream对象 5、遍历文件数据 6、案例 package com.wt.buffer; import java.io.FileI 阅读全文
posted @ 2025-04-20 14:28 市丸银 阅读(4) 评论(0) 推荐(0)
摘要: 一、OutputStreamWriter 输出 1、构造 new OutputStreamWriter(FileOutputStream对象, 编码类型) 2、方法 用的时候就知道 3、案例 package com.wt.buffer; import java.io.FileOutputStream 阅读全文
posted @ 2025-04-20 12:08 市丸银 阅读(8) 评论(0) 推荐(0)
摘要: 一、字节缓存流(速度更快) 1、BufferedInputStream 字节输入缓存流 a、构造 new BufferedInputStream(FileInputStream对象) b、方法 与FileInputStream相似 2、BufferedOutputStream a、构造 new Bu 阅读全文
posted @ 2025-04-20 11:48 市丸银 阅读(23) 评论(0) 推荐(0)
摘要: 一、FileReader 1、概念 字符输入流,硬盘->内存 2、构造 new FileReader(字符串) new FileReader(file对象) 3、方法 //1.read(),一个一个字符读取,返回值字符的数字 //2.read(char[] ), 字符数组读取,返回值读取的长度 // 阅读全文
posted @ 2025-04-20 10:00 市丸银 阅读(16) 评论(0) 推荐(0)
摘要: package com.wt.bytes; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOExceptio 阅读全文
posted @ 2025-04-20 08:57 市丸银 阅读(8) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 97 下一页