Saturday, May 4, 2024
HomeJavaDistinction between URL, URI and URN - Interview Query

Distinction between URL, URI and URN – Interview Query


All three URI, URL, and URN are used to establish any useful resource or identify on the web, however there’s a refined distinction between them. URI is the superset of each URL and URN. By the way in which, the principle distinction between URL and URI is protocol to retrieve the useful resource. URL at all times embody a community protocol e.g. HTTP, HTTPS, FTP and so forth to retrieve a useful resource from its location. Whereas URI, in case of URN simply uniquely identifies the useful resource e.g. ISBN numbers that are instance of URN is used to establish any guide uniquely. On this article, we’ll briefly see what’s URI, URL, and URN after which see the principal distinction between URI, URL, and URN.

What’s URI

What’s URL

URL requirements for Uniform useful resource locator and it’s a subset of URI or Uniform Useful resource Identifier. URL consists of location in addition to the protocol to retrieve the useful resource e.g. in http://java67.blogspot.sg/2012/09/what-is-new-in-java-7-top-5-jdk-7.html, HTTP is a protocol which can be utilized to retrieve useful resource what-is-new-in-java-7-top-5-jdk-7.html accessible in location http://java67.blogspot.com listing. It isn’t essential that URL at all times embody HTTP as protocol, it could possibly use any protocol e.g. ftp://, https:// or ldap://.

What’s URN

URN stands for Uniform Useful resource Identify. URN can be the subset of URI. Probably the greatest examples of URN is ISBN quantity which is used to uniquely establish a guide. URN is totally completely different than URL because it does not embody any protocol.

URL vs URI vs URN

Distinction between URI, URL, and URN

After realizing what’s URI, URL, and URN, it is simple to search out the distinction between them. The principle distinction between URI and URL is that each URL is a URI however not vice versa. Equally, each URN is a URI, however the reverse is just not true. One other distinction between URI and URL is that URL consists of the protocol, which is essential to retrieving data from any location. Listed here are few variations between URI, URL and URN in level format:

1) Each URL and URN is URI as a result of URI is the superset of each URL and URN.
2) URL consists of protocol e.g. http://, ftp:// together with location to establish useful resource e.g. http://www.blogspot.com/abc.html.
3) URN is the unambiguous approach to establish a useful resource. ISBN numbers are the very best examples of the URN.

Here’s a diagram that clearly replicate the connection of URL, URI, and URN on the web:

Difference between URL and URI and URN

That is all on the distinction between URI, URL, and URN. It’s good to understand how a lot distinction they’re although you largely have to cope with URL.

Different Interview questions from Java67 Weblog

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments