Java IO Tutorial - Java File.isAbsolute()








Syntax

File.isAbsolute() has the following syntax.

public boolean isAbsolute()

Example

In the following code shows how to use File.isAbsolute() method.

/* w  w w.  j a v a 2  s .  c  o  m*/


import java.io.File;

public class Main {
  public static void main(String[] args) throws Exception {

    // create new files
    File f = new File("c:/");


    System.out.print(f.isAbsolute());

  }
}

The code above generates the following result.