A socket is an endpoint for communication between two machines.
java.net.Socket
Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web. A resource can be something as simple as a file or a directory, or it can be a reference to a more complicated object, such as a query to a database or to a search engine.
java.net.URL Sockets are low-level connections involving byte streams. URL/URLConnection/HttpURLConnection are abstractions of some protocol (HTTP, FTP).