Capgemini Engineering interview question

Basic oops concepts in java