Your examples make it as clear as the blue sky. Deserves much more views!
There's just a little mistake in the Server's serve_coffee, it should say "Here is your coffee". It is correct in the comments of the test code, but it's wrong ("...cappuccino") in the method implementation.
Thanks for noticing the errors and the kind words. That mean alot. But the mistake is from the method implementation. It should be coffee not cappuccino. The point is that as a child, you should have the same method as the parent and can serve something similar as the parent class method. Cappuccino is a variation of coffee. I wouldn't need to override the parent method if I wanted to do exactly the same thing
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.
Your examples make it as clear as the blue sky. Deserves much more views!
There's just a little mistake in the Server's serve_coffee, it should say "Here is your coffee". It is correct in the comments of the test code, but it's wrong ("...cappuccino") in the method implementation.
Thanks for noticing the errors and the kind words. That mean alot. But the mistake is from the method implementation. It should be coffee not cappuccino. The point is that as a child, you should have the same method as the parent and can serve something similar as the parent class method. Cappuccino is a variation of coffee. I wouldn't need to override the parent method if I wanted to do exactly the same thing