Cognizant interview question

about java and oops concepts