I'm planning to buy my first android phone which has non-removable battery. But in case the phone hangs what to do ? As in general case we remove the battery from the device and plug it in after a few seconds. But what can be done with non-removable device in cases where the phone just stops to responds and even refuses to restart ?
I had to remove the battery from my O4X several times already, as it didn't respond to anything else – so I can see your concern: What to do if the battery cannot be removed then? As to my experiences, devices with a non-removable battery have a reset hole, which serves exactly this purpose: poking it with a needle (or tooth-stick, or something similar) disconnects the battery, as if you had removed it. So the only disadvantage left is you cannot replace the battery (say, with a backup you took along).
Like on a PC, holding down the power button is handled in a much lower level of the firmware, so it's not possible for even an OS problem or a CPU hang to interfere with that operation.
I've been using Android devices with removable and non-removable batteries for several years, and never once needed to remove the battery for the reason you describe.
Consider that the people most likely to need to do such a thing are the OS authors and system integrators themselves, inside Google and the OEM. They have to keep experimenting and testing with unstable builds of the OS every day, so they see the device hang a lot. In a single week, they probably see more hangs than the average end-user sees in the whole lifetime of the device. So if devices with non-removable batteries were a problem like this, they'd never get off the drawing board, because it would be so much harder to develop the software for them.