Why?
See:
Why was feudal Japan able to quickly industrialize and Westernize in the 19th century, and why was China unable to do the same?
How come Japan and China weren't openly colonized by the European powers like they did with the New World, Africa, and the Middle East?
How did Japan industrialize so quickly and so successfully?