I have a superclass, and a subclass that inherits superclass. "xyz" property is defined in superclass. Superclass inherits "handle" class. I am trying to create a "set.xyz(obj)" method in subclass so that when "xyz" is being set, it calls that function but I get an error saying it cannot do that because "xyz" is in the superclass. Also, I have another method "update" in the subclass that I want to be executed whenever I set the "xyz" property by calling the set-dot method on the subclass object. Ideally I would like to be able to execute the following commands:
m = MySubClass;m.xyz = 'a'; % this also calls an "update" method of the subclass
How can I call the set-dot method on a subclass object to set a property of the superclass?
Best Answer