The isAbsolute() method test if given pathname is absolute. This function is system dependent. On Windows a pathname is absolute if its prefix is a drive specifier followed by \\ on UNIX systems, a pathname is absolute if its prefix is a /.
2. Method signature
Parameters:
method does not take any parameter
Returns
true - if this abstract pathname is absolute, false otherwise
3. Examples
3.1. Program that tests several absolute paths using isAbsolute() method
output:
4. Conclusion
In this article, we presented isAbsolute() method from Java File API. Keep in mind that this method works differently on Windows and UNIX systems, which should understandable considering the different approaches to file storage.
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}