Listing A
import java.net.*;
import java.io.*;
 
public void openURLConnection()
{
   try
   {
      URL url = new URL("http://www.mycompany.com");
      URLConnection connection = url.openConnection();
   }
   catch (Exception e)
   {
      System.out.println(e.toString());
   }
}