I have two product classes, Line and Trunk which both require getServiceFee and setServiceFee functions that return/manipulate their serviceFee member variable.
- how do I create a Line or Trunk in a situation where the type of object is only known at runtime
- how do i write a function which is passed the object to be updated assuming I do not know whether the object passed to it is a Line or a Trunk.
Aucun commentaire:
Enregistrer un commentaire