Cognizant interview question

Basic Java question