Uri: Uniform Resource Identifier, a unified resource identifier, used to uniquely identify a resource.
URL: Uniform Resource Locator, a uniform resource locator. It is a specific URI, that is, the URL can be used to identify a resource and also specify how to locate the resource.
URN: Uniform Resource name, which is used to identify a resource by name.
Uri is an abstract high-level concept that defines a unified resource identifier,
URL and urn are specific resource identifiers. URL and urn are both URI types.
In Java Uris, a URI instance can represent absolute or relative, as long as it complies with the URI syntax rules.
The URL class not only conforms to the semantics, but also contains information to locate the resource. Therefore, it cannot be relative and the schema must be specified.
If the path is absolute and can be located, it is okay to use imgurl,
If it is a relative path, do not use imgurl.
Summary:
A URL is a specific URI that not only uniquely identifies a resource, but also provides information for locating the resource.
Uri is a semantic abstract concept. It can be absolute or relative, while URL must provide sufficient information for locating. Therefore, it is absolute,
Generally, the relative URL is targeted at another absolute URL, which is basically absolute.
Note: Here, absolute (absolute) refers to scheme, while relative does not.
Difference between Uri and URL