摘要: public static void copyFile(String inPath, String outPath) { try { FileReader fr = new FileReader(inPath); FileWriter fw = new FileWriter(outPath); ch 阅读全文
posted @ 2022-03-15 16:56 SmallPepsi 阅读(100) 评论(0) 推荐(0)
摘要: public static void testFileReader(String inPath) { try { //创建字符输入流的对象 FileReader fr = new FileReader(inPath); //创建存放数据的缓冲数组 char[] a = new char[10]; / 阅读全文
posted @ 2022-03-15 16:55 SmallPepsi 阅读(181) 评论(0) 推荐(0)
摘要: public class T1 { public static void main(String[] args) { //要复制的文件的路径,复制后所到达的文件夹路径+复制后的文件名 copyFile("C:\\Users\\Administrator\\Desktop\\D1-425\\侯超.jp 阅读全文
posted @ 2022-03-14 21:22 SmallPepsi 阅读(231) 评论(0) 推荐(0)
摘要: public class FileOutputStreamTest { public static void main(String[] args) { testOutputStream(); } public static void testOutputStream(){ try { //指定向2 阅读全文
posted @ 2022-03-14 21:10 SmallPepsi 阅读(40) 评论(0) 推荐(0)
摘要: public class FileInputStreamTest { public static void main(String[] args) {// testFileInputStream();// testOutPutStream(); } /* 文件字节输入流 FileInputStrea 阅读全文
posted @ 2022-03-14 20:43 SmallPepsi 阅读(71) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Dd d = new Dd(); List<String> l1 = new ArrayList<String>(); d.test(l1); List<Integer> l2 = new ArrayList<Inte 阅读全文
posted @ 2022-03-12 16:26 SmallPepsi 阅读(30) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { B1<Object> b1 = new B1<Object>(); System.out.println(b1.test(1)); B2 b2 = new B2(); System.out.println(b2.tes 阅读全文
posted @ 2022-03-12 16:10 SmallPepsi 阅读(164) 评论(0) 推荐(0)
摘要: public class 泛型方法 { public static void main(String[] args) { Cc<Object> c = new Cc<Object>(); System.out.println(c.test1("你好"));//String //泛型方法在调用前,没有 阅读全文
posted @ 2022-03-12 16:03 SmallPepsi 阅读(1573) 评论(0) 推荐(0)
摘要: public class 泛型类 { public static void main(String[] args) { A<String> a1 = new A<String>();//在new A的对象指定泛型的类型 类型是String a1.setKey("xxxx");//对象使用setKey 阅读全文
posted @ 2022-03-12 16:01 SmallPepsi 阅读(43) 评论(0) 推荐(0)
摘要: Student s1 = new Student(14,"张三");Student s2 = new Student(12,"王五");Student s3 = new Student(16,"李四");Student s4 = new Student(11,"lucy");List<Student 阅读全文
posted @ 2022-03-11 16:15 SmallPepsi 阅读(59) 评论(0) 推荐(0)