TOKYO — Japan still faces deep structural problems. Its population is aging and dwindling. China has stepped up its manufacturing game. Corporate stalwarts like Toshiba and Kobe Steel have stumbled.

Investors appear to be looking at the bright side.

Japan’s main stock index rose to its highest level in almost 21 years on Wednesday, buoyed by a broad rally in global markets as well as growing optimism about the Japanese economy. The surge came despite the continuing problems at Kobe Steel, a Japanese stock market stalwart. Its shares sank sharply for a second day after revelations that it had falsified data about the quality of aluminum and copper products shipped to hundreds of customers.

In large part, Japan’s stronger stock market is part of a global rise in optimism. Stock market measures in the United States have also hit new highs in recent weeks, while stocks in South Korea also hit a record on Wednesday. Markets have been lifted by robust global growth and expanding corporate profits, as the world finally appears to be shrugging off years of crises and sluggish growth.

But Japan has some of its own good news to share.

Japan’s gross domestic product has expanded for six consecutive quarters, the first time it has gone that long without a contraction in 11 years. Unemployment is at multidecade lows, and corporations are experiencing a surge in profits. Even Japan’s longtime economic bugbear — persistent wage and price deflation — has eased, with both consumer prices and incomes showing modest gains.