If I do this
fis = new FileInputStream(new File(\".\").getAbsolutePath() + \"/sudoinput.txt\");
Its trying to write to this location on the ser
Agree with Sandiip Patil. If you didn't have folder inside your resources then path will be /sudoinput.txt
or in folder /folder_name/sudoinput.txt.
For getting file from resources you should use YourClass.class.getResource("/filename.txt");
For example
Scanner scanner = new Scanner(TestStats.class.getResourceAsStream("/123.txt"));
or
Scanner scanner = new Scanner(new `FileInputStream(TestStats.class.getResource("/123.txt").getPath()));`
Also look at: this