DXC Technology interview question

about oops concept and c++