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
OK to include lagged DV as a control?Hello, I was wondering whether it is OK to include a lagged DV as a control? In the current projec…
Fixed Effects EstimationHi Everyone, I am currently running a FE regression with panel data on OECD countries, looking at t…
-project, replicate- and .ster files.Dear Statalist. I use Robert Picard 's incredibly useful -project- command frequently. My workflow …
Fixed effects - unconditional quantile regressionHello, Can you help me with the following: I am using the command "xtrifreg" with country fixed eff…
Regression with 150 variablesHi, I want to run a simple regression but I have 150 variables and I do not want to type all of the…
Subscribe to:
Post Comments (Atom)
0 Response to Inheritance and virtual functions
Post a Comment