随笔分类 -  IO字符流。

摘要:public class Test3{ public static void main(String[] args){ 1.创建带缓冲的输入流对象 BufferedReader br = new BufferedReader (new FileReader("zzz.txt")); 2.创建双列集合 阅读全文
posted @ 2020-06-27 18:39 一块 阅读(256) 评论(0) 推荐(0)
摘要:public class Demo_TransIO{ public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException,IOException{ InputStreamR 阅读全文
posted @ 2020-06-27 17:41 一块 阅读(165) 评论(0) 推荐(0)
摘要:装饰设计模式优点:耦合性不强,被装饰的类的变化与装饰类的变化无关 public static void main (String[] args){ HeiMaStudent hms = new HeiMaStudent (new Student()); hms.code(); } interface 阅读全文
posted @ 2020-06-23 22:23 一块 阅读(137) 评论(0) 推荐(0)
摘要:public class Demo5_LineNumberReader{ public static void main(String[] args) throws IOException{ LineNumberReader lnr = new LineNumberReader(new FileRe 阅读全文
posted @ 2020-06-23 22:02 一块 阅读(136) 评论(0) 推荐(0)
摘要:public class Test1(){ 将一个文本文档上的文本反转,第一行和倒数第一行交换,第二行和倒数第二行交换。 分析:1.创建输入输出流对象 2.创建集合对象 3.将读到的数据存储在集合中 4.倒着遍历集合将数据写到文件上 5.关流。 注意事项:流对象应该尽量晚开早关。 public st 阅读全文
posted @ 2020-06-22 22:24 一块 阅读(225) 评论(0) 推荐(0)
摘要:public class Demo4_Buffered(){ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader (new FileRead("xxx.tx 阅读全文
posted @ 2020-06-22 22:02 一块 阅读(440) 评论(0) 推荐(0)
摘要:public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader (new FileReader("xxx.txt")); BufferedWriter bw = new 阅读全文
posted @ 2020-06-22 21:42 一块 阅读(159) 评论(0) 推荐(0)
摘要:public static void main(String[] args) throws IOException{ FileRead fr = new FileRead ("xxx.txt"); FileWrite fw = new FileWrite ("yyy.txt"); char [] a 阅读全文
posted @ 2020-06-22 21:20 一块 阅读(205) 评论(0) 推荐(0)
摘要:public static void main(String[] args) throws IOException{ FileReader fr = new FileReader("xxx.txt"); FileWrite fw new FileWrite ("zzz.txt"); int c; w 阅读全文
posted @ 2020-06-22 21:01 一块 阅读(126) 评论(0) 推荐(0)