URI uri = new URI("https://example.com/?name=John&age=30"); String name = uri.getQuery().split("=")[1]; // "John"
URI uri = new URI("https://example.com/?name=John&age=30"); boolean hasEmail = uri.getQuery().contains("email"); // falseThis example creates a URI object for the URL "https://example.com/?name=John&age=30". The `getQuery()` method is called on the URI object to retrieve the query component, which is then checked if it contains the "email" parameter using the `contains()` method. The `java.net` package library contains classes for networking with URLs and URIs, including `java.net.URI`.