What is wrong with my code. it poulates the arraylist with only the filename "c:\testfile.txt" i need it to populate it with the contents of the file.

private ArrayList<String> Files2Delete = new ArrayList<String>();
private String fName = "c:\\TestFile.txt";

private void fileCollection ()
        Scanner in = new Scanner(fName);
        int i = 1;
        while (in.hasNextLine())
            String line = in.nextLine();

The scanner constructor takes a string as a source to read from, the string is not a filepath

use this

File file = new File(fName);

Scanner in = new Scanner(file);