File IsAbsolute() Example
Tests whether this abstract pathname is absolute.
File class IsAbsolute() method example. This example shows you how to use IsAbsolute method.This method Tests whether this abstract pathname is absolute.
Here is the code:-
/**
* @Program that Tests whether this abstract pathname is absolute..
* IsAbsolute.java
* Author:-RoseIndia Team
* Date:-30-May-2008
*/
import java.io.*;
public class IsAbsolute {
public static void main(String[] args) {
File f = new File("/home/girish/Desktop/g.txt");
if (f.exists()) {
boolean b=f.isAbsolute();
System.out.println("is Absolute : " + b);
} else {
System.out.println("File does not exists");
}
}
} |
|