Java programs that contain file paths, making them compatible on Windows and Linux

If your Java application makes use of files using paths, it’s best not to use slash “/” or backslash “\” hard coded in your source code. Use the following to ensure your program would work as expected on both Windows and Unix like systems.

File.separator

Leave a Reply

Your email address will not be published. Required fields are marked *