Infosys Interview Question

Concept of oops, basic coding