Java IO Tutorial - Java File separator








Syntax

File.separator has the following syntax.

public static final String separator

Example

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

import java.io.File;
/*w w  w.ja v  a  2  s.c o  m*/
public class Main {

  public static void main(String[] args) {

    System.out.println(File.separator);

  }
}

The output: