What is the difference between using File.separator
and a normal /
in a Java Path-String?
In contrast to double backslash \\\\
Although using File.separator to reference a file name is overkill (for those who imagine far off lands, I imagine their JVM implementation would replace a /
with a :
just like the windows jvm replaces it with a \
).
However, sometimes you are getting the file reference, not creating it, and you need to parse it, and to be able to do that, you need to know the separator on the platform. File.separator helps you do that.