###Making URL Connections
To access web servers in a Java program, you will want to work on a higher level than making a socket connection and issuing HTTP requests. In the following sections, we discuss the classes that the Java library provides for this purpose. ####URLs and URIs The URL and URLConnection classes encapsulate much of the complexity of retrieving information from a remote site. You can construct a URL object from a string: URL url = new URL(urlString);
A URI is a purely syntactical construct that contains the various parts of the string specifying a web resource. A URL is a special kind of URI, namely, one with sufficient information to locate a resource. Other URIs, such as mailto:cay@horstmann.com are not locators—there is no data to locate from this identifier. Such a URI is called a URN (uniform resource name).