Wipro interview question

Question based on the oops followed a coding question.