To see where Java is looking for your file, put in your main method this statement:
System.out.println(System.getProperty("user.dir"));
Other way to add file in src directory as shown and add code
Code is
File file = new java.io.File("src/testCase.txt");
Scanner in = null;
try {
in = new Scanner(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}