i have a class say A that has a protected method say methodA(), then i extend a class B from class A and do not override the methodA(); then i created a class C and extend it with class B and i want to override the methodA();
how can i do so with out overriding methodA(); in class B,
class A{
public funciton methodA():void {
// do stuff
}
}
class B extends A{
//do stuff but not override the methodA
}
class C extends B{
override public function methodA():void {
// possible or not
}
}
is it possible (i think not just want to confirm)
regards.
It’s possible, And I think simple test helps you. I’m not familiar with your language syntax, but just override on same method name as in
Ain classC.