OJAS Softech interview question

Oops concepts in details and coding