Infosys interview question

Basic oops questions