DXC Technology interview question

Why is Java a platform independent language?