As a note, I'd say that the examples used could use some small adjustments.
A cake class wouldn't really have a method for preheating the oven. Same with pizzas not having methods for ordering pizzas.
A child class of a pizza would more likely be type of pizza like Margherita(Pizza). And then you could have a class like PizzaShop with the method order_pizza().
OrderPizza itself seems more like a function or a method of another class, than a class itself.
Thanks for your feedback, anyways all these are simple illustrations to help newbies come up with speed, anyways there is always a room for adjustment.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
As a note, I'd say that the examples used could use some small adjustments.
A cake class wouldn't really have a method for preheating the oven. Same with pizzas not having methods for ordering pizzas.
A child class of a pizza would more likely be type of pizza like Margherita(Pizza). And then you could have a class like PizzaShop with the method order_pizza().
OrderPizza itself seems more like a function or a method of another class, than a class itself.
Thanks for your feedback, anyways all these are simple illustrations to help newbies come up with speed, anyways there is always a room for adjustment.