Capgemini interview question

based on java , oops concepts