Cognizant interview question

Java programs