Cognizant interview question

java oops scenario based questions