Both public and private buildings such as schools and courthouses may fly the national flag. In some countries, the national flags are only flown from non-military buildings on certain flag days. There are three distinct types of national flag for use on land, and three for use at sea, though many countries use identical designs for several (and sometimes all) of these types of flag.
Historically, flags originate as military standards, used as field signs. The practice of flying flags indicating the country of origin outside of the context of warfare emerges with the maritime flag, introduced during the age of sail, in the early 17th century. It was only with the emergence of nationalist sentiment from the late 18th century that the desire was felt to display national flags also in civilian contexts, notably the US flag, in origin adopted as a naval ensign in 1777, which after the American Revolution[year needed] began to be displayed as a generic symbol of the United States, and the French Tricolore which became a symbol of the Republic in the 1790s. The British Union Flag was designed as a naval ensign in the 17th century, but it was not identified as “national flag” of the United Kingdom prior to 1908.
Most countries of Europe adopted a national flag in the course of the 19th and early 20th centuries, often based on older (medieval) war flags. For example, the flag of Denmark was introduced in 1854, based on a 17th century design. The flag of Switzerland was introduced in 1889, also based on medieval war flags. The Netherlands introduced two national flags in 1813 (either an orange-white-blue or a red-white-blue tricolour; the final decision in favour of red was made in 1937). The non-European powers followed the trend in the late 19th century, the flag of Japan being introduced in 1870, that of Qing China in 1890. Also in the 19th century, most countries of South America introduced a flag as they became independent (Peru 1820, Bolivia 1851, Colombia 1860, Brazil 1822, etc.)