overriding an abstract method in the defining abstract class
I was going through the premium course on refactoring to freshen up my skills, when i suddenly encountered a rather questionable code example.
The code example is in: Refactoring >> Exctract Subclass.
The questionable lines are theΒ multipleΒ definitions of getUnitPrice() in the abstract class.
There is a abstract definition, which is totally fine and part of the refactoring process, but there is also, in the same abstract class, an empty definition that overrides the getUnitPrice function.Β

Is there any reasoning behind this example or was the empty function not supposed to be there at the end of the example?
edit: im not sure in which type of post such a post belongs so i just tried my luck in discussions, fell free to change the type toΒ an appropriate one
ΠΡΠ²Π΅Ρ
Hi Matthias!
Thanks for reporting this! It's definitely a bug and I've just fixed. Thanks again!
Π‘Π΅ΡΠ²ΠΈΡ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΈ ΠΊΠ»ΠΈΠ΅Π½ΡΠΎΠ² ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Π½Π° ΠΏΠ»Π°ΡΡΠΎΡΠΌΠ΅ UserEcho
Hi Matthias!
Thanks for reporting this! It's definitely a bug and I've just fixed. Thanks again!