Cognizant interview question

How does a java code work?