Is pre_randomize() virtual? If yes, do you use the virtual keyword when y…
Is pre_randomize() virtual? If yes, do you use the virtual keyword when you define it? If no, how does a pre_randomize() defined in an extended class take effect?
Model answer
No, pre_randomize() is not virtual, and it is defined without the virtual keyword. It still appears to behave as virtual. randomize() is virtual and calls pre_randomize() automatically, so the version belonging to the object's actual class runs, even when randomize() is called through a base class handle. The same applies to post_randomize() . An extended class that defines its own version replaces the base version. It should call super.pre_randomize() , or the base version's steps are skipped.