Different operating systems use different separator characters for file paths. For example, Windows uses \ (backslash) and Unix uses / (forward slash). If you want to write a
Java program that runs on any operating system then
you should use File.separator instead of hard-coding characters like \ or / in file paths.