1.

Answer the question (i) & (ii) after going through the following code. (assume all necessary header files are included in program)(i) Give the name of the feature of OOP which is implemented by Function 1 & 2 together in the above class Game.(ii) Anuj made changes to the above class Game and made Function 3 private. Will he be able to execute the Line 1 successfully given below? Justify.void main(){Game ABC; //Line 1}

Answer»

(i) Polymorphism or Function Overloading or Constructor Overloading.

(ii) Yes, an error “Destructor for Game is not accessible” will come. As there is a destructor defined in the class and it cannot be made private.



Discussion

No Comment Found

Related InterviewSolutions