help me please
-
how to write main class for run this class. 1. edit this class. 2. create main class for run I need to write , read text file path C:\\file.txt anyone help me please. package import java.io.*; public class TextFileOperator { public TextFileOperator(String path){ f = new File(path); } File f; public void write(String text, boolean isAppend){ FileOutputStream out = new FileOutputStream(f,isAppend); OutputStreamWriter wr = new OutputStreamWriter(out); wr.write(text); wr.close(); out.close(); } public String read() { FileReader reader = new FileReader(f); BufferedReader bf = new BufferedReader(reader); StringBuilder bd = new StringBuilder(); String s; while((s = bf.readLine()) != null){ bd.append(s); bd.append("\n"); } return bd.toString(); } }
-
how to write main class for run this class. 1. edit this class. 2. create main class for run I need to write , read text file path C:\\file.txt anyone help me please. package import java.io.*; public class TextFileOperator { public TextFileOperator(String path){ f = new File(path); } File f; public void write(String text, boolean isAppend){ FileOutputStream out = new FileOutputStream(f,isAppend); OutputStreamWriter wr = new OutputStreamWriter(out); wr.write(text); wr.close(); out.close(); } public String read() { FileReader reader = new FileReader(f); BufferedReader bf = new BufferedReader(reader); StringBuilder bd = new StringBuilder(); String s; while((s = bf.readLine()) != null){ bd.append(s); bd.append("\n"); } return bd.toString(); } }
-
how to write main class for run this class. 1. edit this class. 2. create main class for run I need to write , read text file path C:\\file.txt anyone help me please. package import java.io.*; public class TextFileOperator { public TextFileOperator(String path){ f = new File(path); } File f; public void write(String text, boolean isAppend){ FileOutputStream out = new FileOutputStream(f,isAppend); OutputStreamWriter wr = new OutputStreamWriter(out); wr.write(text); wr.close(); out.close(); } public String read() { FileReader reader = new FileReader(f); BufferedReader bf = new BufferedReader(reader); StringBuilder bd = new StringBuilder(); String s; while((s = bf.readLine()) != null){ bd.append(s); bd.append("\n"); } return bd.toString(); } }
I want to learn java programming... after that i'll create a website for java , c , c++ programming tutorials specially for beginners, just like me..:)
-
I want to learn java programming... after that i'll create a website for java , c , c++ programming tutorials specially for beginners, just like me..:)