import java.net.URI; public class Example { public static void main(String[] args) { URI uri1 = URI.create("http://www.example.com"); URI uri2 = URI.create("/about"); System.out.println(uri1.isAbsolute()); // true System.out.println(uri2.isAbsolute()); // false } }In this example, we create two URIs: one absolute and one relative. We then use the isAbsolute() method to determine whether each URI is absolute or not, and print the results. The java.net.URI class is part of the Java Standard Library, so it does not require any external package libraries.