Cognizant interview question

basics of java