public static void filein() throws FileNotFoundException { File file = new File("D:/file2/result2.txt"); FileInputStream in = new FileInputStream(file); try { int content; while ((content = in.read()) != -1) { System.out.print((char) content); } } catch (IOException e) { e.printStackTrace(); } try { in.close(); } catch (IOException e) { e.printStackTrace(); } }

public static void fileout throws FileNotFoundException File file=new FileDfile2result2txt;FileOutputStream out=new FileOutputStreamfile;String str=小明-18-90;小红-17-95;老刚-29-60; try outwrites

原文地址: https://www.cveoy.top/t/topic/ipGj 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录