Hello i am trying to make a programm that is reading input from a .txt and then places it into an other .txt with some changes.. Println is used just to test the results
INPUT :
This should be changed
I dont know why it doest change
What is wrong..
RESULTS :
This should be changed
This should be changed
I dont know why it doest change
I dont know why it doest change
What is wrong..
What is wrong..
import java.io.* ; 
public class dunno
{
    public static void main(String[] args)
    {
        BufferedReader inputStream = null;
        PrintWriter outputStream = null ;
        try
        {
            inputStream =new BufferedReader(new FileReader("in.txt"));
            outputStream =new PrintWriter(new FileWriter("out.txt"));
            String k;
            while ((k = inputStream.readLine()) != null ){
               System.out.println(k);
               k.replace("s","p");
               System.out.println(k);
               outputStream.println(k + " edited_line");
            }
            if (inputStream != null){
                inputStream.close();
            }
            if (outputStream != null){
                outputStream.close();
            }
        }
        catch(IOException e){
                System.out.println("try again.");
        }
    }
 }
 
    