Question: 4. Create a base class Base with an abstract print() method that is overridden in a derived class Derived. The overridden version of the
4. Create a base class Base with an abstract print() method that is overridden in a derived class Derived. The overridden version of the method prints the value of an int variable defined in the derived class. At the point of definition of this variable, give it a nonzero value, say, 11. In the base class constructor, call this method. In main(), create an object of the derived type, and then call its print() method. Explain the results. (1 point)
Step by Step Solution
3.39 Rating (149 Votes )
There are 3 Steps involved in it
To solve this problem you need to create a base class Base with an abstract method print and a deriv... View full answer
Get step-by-step solutions from verified subject matter experts
