Q:

Java: Make a void-method out of this class (textfile changer)

What I want to do: My class copytest reads a textfile, edits one character and save this new file in a new directory. I want to program a void-method out of it, which does exactly the same and can then be used the following way:
copy(String "C:\\Old.txt", String "C:\\New.txt", int 1, int 1)

Now copy does exactly the same as my old class copytest, it reads the old file, edits it and saves it. 
My first idea was to have two files as the first to arguments, but this is obviously impossible. My new idea is to give the method two strings of the wanted directories of the old and the new file. It still doesn't work. I hope, you understand, what I want to do and how to solve this problem.
Old class code (works):
import java.io.*;
import java.util.Scanner;

public class copytest {

    public static void main(String[] args) throws Exception {       
        readFile();
    }

    public static void readFile() throws Exception {

        // Location of file to read
        File file = new File("...old.txt");

        Scanner scanner = new Scanner(file);

        int lineNumber=1;
        int charNumber=1;
        String wantedChar="r";
        int i=0;
            while (scanner.hasNextLine()) {
                String line = scanner.nextLine();
                if (i == lineNumber+2) {
                    if (line.length() >= charNumber) {
                        line = line.substring(0,charNumber-1) + wantedChar + line.substring(charNumber);
                    }
                }
                writeFile(line);
                i++;
            }       

        scanner.close();
        System.out.println("File copied."); 
    }

    public static void writeFile(String copyText) throws Exception {

        String newLine = System.getProperty("line.separator");

        // Location of file to output
        Writer output = null;
        File file = new File("...new.txt");
        output = new BufferedWriter(new FileWriter(file, true));
        output.write(copyText);
        output.write(newLine);
        output.close();     
    }

}

New void code (first try with file as argument):
public void copy(file old, file new, int x, int y) {

    public static void readFile() throws Exception {

        Scanner scanner = new Scanner(old);

        int lineNumber=y;
        int charNumber=x;
        String wantedChar="r";
        int i=0;
            while (scanner.hasNextLine()) {
                String line = scanner.nextLine();
                if (i == lineNumber+2) {
                    if (line.length() >= charNumber) {
                        line = line.substring(0,charNumber-1) + wantedChar + line.substring(charNumber);
                    }
                }
                writeFile(line);
                i++;
            }       

        scanner.close();
        System.out.println("File copied."); 
    }

    public static void writeFile(String copyText) throws Exception {

        String newLine = System.getProperty("line.separator");

        // Location of file to output
        Writer output = null;
        File file = new File(new.getPath());
        output = new BufferedWriter(new FileWriter(file, true));
        output.write(copyText);
        output.write(newLine);
        output.close();     
    }

    readFile();

}

New try with strings as argument, but still doesn't work:
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.Writer;
import java.util.Scanner;

public class copytestnew {

public void copy(String old, String newone, int x, int y) {

        // Location of file to read
        File file = new File(old);

        Scanner scanner = new Scanner(file);

        int lineNumber=y;
        int charNumber=x;
        String wantedChar="r";
        int i=0;
            while (scanner.hasNextLine()) {
                String line = scanner.nextLine();
                if (i == lineNumber+2) {
                    if (line.length() >= charNumber) {
                        line = line.substring(0,charNumber-1) + wantedChar + line.substring(charNumber);
                    }
                }
        String newLine = System.getProperty("line.separator");

        // Location of file to output
        Writer output = null;
        File file2 = new File(newone);
        output = new BufferedWriter(new FileWriter(file2, true));
        output.write(line);
        output.write(newLine);
        output.close(); 
                i++;
            }       

        scanner.close();
        System.out.println("File copied"); 
    }

}

A:

I remember you! I answeared you last time on how to replace the char at one of the lines.    
First, change the decleration to
public static void copy(String old, String newone, int x, int y) throws IOException {

NOTICE the throws statment! 
And now when you want to call this method you should use it inside a try-catch block or declear that you throwing exception same as you did at the copy function.

