Cognizant interview question

Oops concept in java explanation