URI baseURI = new URI("http://example.com/"); URI relativeURI = new URI("/path/to/resource"); URI resolvedURI = baseURI.resolve(relativeURI); System.out.println(resolvedURI.toString()); // outputs "http://example.com/path/to/resource"In this example, we first create a base URI object representing "http://example.com/". We also create a relative URI object representing "/path/to/resource". We then call the resolve method on the base URI object, passing in the relative URI object, which returns a new URI object representing the resolved URI. The java.net.URI package provides classes and interfaces for handling Uniform Resource Identifiers (URIs) and their components.