client =email(client send_email("hello"client set_provider(yahoo()client send_email("hello"outputsending 'hellofrom gmail sending 'hellofrom yahoo customization via inheritance specializing inherited methodsthe tree-searching model of inheritance turns out to be great way to specialize systems because inheritance finds names in subclasses before it checks superclassessubclasses can replace default behavior by redefining the superclass' attributes in factyou can build entire systems as hierarchies of classeswhich are extended by adding new external subclasses rather than changing existing logic in place the idea of redefining inherited names leads to variety of specialization techniques