Japan has a long history of having relationships with different countries. It has faced both friendly and hostile relationships throughout its history.
The earliest documented foreign relations Japan had was with China, starting in the 6th century. This was mostly a friendly relationship, with Japan trading goods and services with the Chinese.
The 1600s were a more hostile period when Japan closed their ports to all foreign traders, with the exception of the Dutch and Chinese. They wanted to limit foreign influence on their culture, and keep their own way of life preserved. This policy was known as 'Sakoku'.
In 1853, Japan opened its borders to the United States, and eventually to other countries such as France, and the UK. This marked the start of a period of modernization and reform, which lasted until the early 1900s.
During World War II, Japan was allied with several countries, including Germany and Italy. After the war, Japan slowly began to re-establish its foreign relationships, joining the United Nations and working towards peace in the region.
Since then, Japan has continued to have strong relationships with many countries, and is now a major economic powerhouse. It continues to work towards peace and stability in the Asia-Pacific region.