Tip 38: Share Methods with Inheritance
It was hard.
How does inheritance work? Return to your
Coupon class. Suppose you want
FlashCoupon that has deeper discounts but a shorter time span. To create
that class, simply declare a new class called
FlashCoupon that inherits from the
Coupon class using the
FlashCoupon class inherits all the existing properties and methods.
For example, you can access the
price and the