Hi everyone,
my question is in the use of virtual functions and they are actually two questions:
1.- Do we have to re-declare the function in the subclass that is actually going to implement the function?
2.- Whether we do or not, does the function in the subclass have a particular level of exposure: public or private?
The way I understand virtual functions is that they are useful to declare a functionality that subclasses should have, and the type of object they should return. For example if you’re programming maximum likelihood estimators, you could have the super class MLEstimator where you define all the functions that a particular estimator must implement, like MLEval, for the evaluator, Estimate, Display, etc... However, if they force a particular exposure level to the function when implemented it can be troubling. For example, I may want Estimate to be public, and to call Display from inside Estimate and, thus, to be private.
Thanks!!!
Related Posts with Inheritance and virtual functions
Interrater agreementDear all I have a dataset titled "readings". This consists of readings on the same XRays by 3 diffe…
Replacing missing values after appendingI want to create a panel dataset from two waves of the World Bank Enterprise Surveys (One collected …
How to Create Ratio variable from independent variables for panel dataHi.. I am working on female and male tertiary enrolment rates and its impact on meritocracy. For the…
asdoc update : addition of inspect commandThe latest version (Version 2.3.9.2 : Changes made on Nov 3, 2020) of asdoc can now export the outpu…
Removing middle character from a set of variablesHi everyone, This might have a simple solution but I'm stuck. I have a set of variables that goes …
Subscribe to:
Post Comments (Atom)
0 Response to Inheritance and virtual functions
Post a Comment