File.separator & separatorChar

separator

public static final String separatorThe system-dependent default name-separator character, represented as a string for convenience. This string contains a single character, namely separatorChar.

文件分隔符,各个操作系统不一样
如WIndows的是 "\ ",而Unix的是 "/ "

java中, "\\ "表示分隔,相当于在windows中的 "\"

separatorChar
public static final char separatorCharThe system-dependent default name-separator character. This field is initialized to contain the first character of the value of the system property file.separator. On UNIX systems the value of this field is '/'; on Microsoft Windows systems it is '\\'.

你可能感兴趣的:(windows,unix,Microsoft)