+1 vote
in Class 12 by kratos

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 *** the Line 1 successfully given below? Justify.

void main()

{

Game ABC; //Line 1

}

1 Answer

+2 votes
by kratos
 
Best 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.

...