Infosys interview question

Concept of oops, basic coding