Answer
Joseph I was crowned King of Hungary at the age of 9 in 1687. He was the second son of Emperor Leopold I and his second wife, Margaret Theresa of Spain. Joseph's elder brother, Leopold, had died in 1685, making Joseph the heir to the throne. However, as he was still a minor, Joseph's father ruled as regent until he came of age in 1697.