java开发_读写txt文件操作
发布时间:2020-12-14 06:27:41 所属栏目:Java 来源:网络整理
导读:@SuppressWarnings("static-access" MyFile myFile = ( i = 0; i myFile.creatTxtFile("test" myFile.writeTxtFile("显示的是追加的信息" + String str = System.out.println("*********n" + } String path = "txt/" creatTxtFile(String name) flag = file
@SuppressWarnings("static-access" MyFile myFile = ( i = 0; i < 5; i++ myFile.creatTxtFile("test" myFile.writeTxtFile("显示的是追加的信息" + String str = System.out.println("*********n" + }
String path = "txt/"
creatTxtFile(String name) flag = filenameTemp = path + name + ".txt" File filename = (! flag =
writeTxtFile(String newStr)
flag = String filein = newStr + "rn" String temp = ""
FileInputStream fis = InputStreamReader isr = BufferedReader br =
FileOutputStream fos = PrintWriter pw =
File file =
fis = isr = br = StringBuffer buf =
( j = 1; (temp = br.readLine()) != ; j++ buf =
buf = buf.append(System.getProperty("line.separator"
fos = pw = |