You can have a situation where two different classes are related, but there is no inheritance going on. This is referred to as composition -- where one class makes use of code contained in another class. For example, imagine we have a Package class which represents a software package. It contains attributes about the software package, like name, version, and size. We also have a Repository class which represents all the packages available for installation. While there’s no inheritance relationship between the two classes, they are related. The Repository class will contain a dictionary or list of Packages that are contained in the repository.
Christine Rafla
Email us at - techlaboffice77@gmail.com
Sur cette page du site, vous pouvez voir la vidéo en ligne 56 Composition | Python [ COMPLETE COURSE ] durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Tech Lab 21 août 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 184 fois et il a aimé 2 téléspectateurs. Bon visionnage!