1. Uri and URL definition URI: Uniform Resource Identifier (Uniform Resource Identifier)
URL: Uniform Resource Locator (Uniform Resource location) Frankly, both URI and URL are location of the resource, that is, the position information of this resource, Just like latitude and longitude, you can show where you are in the world. A URI is a broad definition, and a URL is a subset of the URI, which means that the URL is part of the URI. In other words, each URL is a URI, but not every URI is a URL. The most obvious difference between them is that in Java.net.URI you can only see some of his attributes, he just represents a location, but you have no way to get a stream of this object through a URI, but the URL is different. Java.net.URL This class provides a method (OpenConnection ()), through which we can manipulate him through the IO stream. But I don't seem to see the relevant method in the URI. 2, URL syntax URL is similar to URI, the format of the two is almost similar, but we touch the URL is more than the example of the URL to explain URLs provide a means of accessing arbitrary resources on the Internet, but these resources can be accessed through different methods (such as HTTP, FTP, SMTP), which, in any case, are basically composed of 9 parts: < Scheme>://<user>:<password>@
Uri and URL