Java I/O How to - Check to see if a path is absolute


We would like to know how to check to see if a path is absolute.


import java.nio.file.FileSystems;
import java.nio.file.Path;
// w  ww  .  j  a va  2 s  . co  m
public class Main {

  public static void main(String[] args) {
    Path path = FileSystems.getDefault().getPath("/home/docs/status.txt");


The code above generates the following result.