Cognizant Interview Question

Oops concept in java explanation