Whether this abstract pathname is absolute

ReturnMethodSummary
booleanisAbsolute()Tests whether this abstract pathname is absolute.

import java.io.File;

public class Main {

  public static void main(String[] args) {
    File aFile = new File("c:/");
    System.out.println(aFile.isAbsolute());

  }
}

The output:


true

import java.io.File;

public class Main {

  public static void main(String[] args) {
    File aFile = new File("abc.txt");
    System.out.println(aFile.isAbsolute());

  }
}

The output:


false
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.