reading from input file and then write on it
I need to read from an input file and then write to the same file??
can I do this?
my code is the following
but when I write the above code and then start reading the lines from the file I have got blank file
Scanner inFile2 = new Scanner(new FileInputStream(file2));
BufferedReader reader2 = new BufferedReader(new FileReader(file2));
//BufferedWriter writer2 = new BufferedWriter(new FileWriter(file2));
line2 = reader2.readLine() ;
can you please help me
what is the problem of defining the reading and writing file