Cognizant Interview Question

How does a java code work?