Hello. When destroying an object that inherits from a superclass, should the superclass have a method which nullifies itself or should the subclass which the object comes from have a method to nullify itself?
Thank you for any answers.
Hello. When destroying an object that inherits from a superclass, should the superclass have a method which nullifies itself or should the subclass which the object comes from have a method to nullify itself?
Thank you for any answers.
The superclass should, so all subclasses can inherit the same method. If you need different nullifying behavior for a subclass, then write a non-inherited one.