Capgemini interview question

oops concepts and java 8