Cognizant Interview Question

Basic oops quetions