Intro
This examples will demonstrates how to get file separator using System class. To get file separator, you can use System.getProperty() method with parameter "file.separator".
Examples
package com.freesamplecode.java.basic; public class GetFileSeparatorDemo { public static void main(String[] args){ String fileSeparator = System.getProperty("file.separator"); System.out.println("File Separator : "+fileSeparator); } }
Output
File Separator : \
0 comments: