Java File separatorChar

Syntax

File.separatorChar has the following syntax.

public static final char separatorChar

Example

In the following code shows how to use File.separatorChar field.


import java.io.File;
/*from   ww  w.  j  a v a2s . com*/
public class Main {

  public static void main(String[] args) {

    System.out.println(File.separatorChar);

  }
}

The output: