URL url = new URL("http://www.example.com");
URL url = new URL("http://www.example.com/test.html"); InputStream input = url.openStream();
URL url = new URL("https://api.example.com/data?param=value"); URLConnection connection = url.openConnection();This example creates a connection to the API endpoint https://api.example.com/data with the query parameter "param=value". The java.net package library is used for networking operations in Java.