There's also the matter of the gender imbalance. What will happen to a country with tens of millions of young men with no possibility of finding a female partner in a country where the number of elderly is growing as the number of those young men who support them is not.
In all likelihood, this will exacerbate the population decline as many young men will simply emigrate to other areas. For China, since it is technically a growing economy, moving from an agrarian system to one that is more capitalistic, they may be able to absorb some of that with economic gains offsetting population demographic changes. But that is hard to say. China is very secretive about its economy and its banking sector. Many economists fear that things are far more tenuous with their economy and that their shadow banking industry has too much exposure to bad debt.
Japan however is in a terrible quagmire. Their economy is mature and they have been struggling with growth for decades now. With a non-existent immigration policy and nightmarish debt levels, I can't see how things will end well for them.
Japan had one of the largest property and stock bubbles in history that burst in the late 80s. Since then, they basically have a zombie banking system with the government propping things up with their monetary policy while the population, through a deep seeded sense of patriotism, has been also taking on a massive debt burden. They were offering 100 year mortgages at the height of their housing debacle and people even now, still seem like they have a duty to take on high levels of debt to keep things afloat.
Only time will tell how things will play out. But there is definitely no easy solution and a default of some sort may eventually become inevitable.