Why is File.separator in Android using?

你离开我真会死。 提交于 2019-12-12 04:19:18

问题


There's many projects which are using File.separator as path separators. But why do it's using on Android? I know that it can be useful on cross-platform apps, where Windows using \, and Linux using / as a separators, but are developers really think that Android projects will be launch on Windows in future, or is it only an historical reasons? Obviously, that it's more useful to use / instead of File.separator, even to add it to the variable like fileSep or fs.

Thanks!


回答1:


Android runs on top of Linux. So all file separators and similar settings use the same as Linux. People using File.separator are either running (or copying) Java code meant to be multi-platform, or are being extremely cautious.



来源:https://stackoverflow.com/questions/44558780/why-is-file-separator-in-android-using

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!