Infosys Interview Question

simple oop concepts, programming logic