Cognizant Interview Question

Explain me how the code is executed in Java and also brief me about JDK and JRE.