URI uri1 = URI.create("https://example.com/path?query=value#fragment"); URI uri2 = URI.create("https://example.com/path?query=value#fragment"); boolean result = uri1.equals(uri2); // result is true
URI uri1 = URI.create("https://example.com/path?query=value#fragment"); URI uri2 = URI.create("https://example.com/path?query=different-value#fragment"); boolean result = uri1.equals(uri2); // result is falseThe class package library for java.net.URI is java.base.