Computer Networking
Databases
Languages
Production Software
Real_Time_Systems
Security

Lec 15 Inheritance

class Cat:
    def __init__(claw_sharpness)
    def knead(self):
        print()

class Lion(Cat):
    pass

mini = Lion(3) # 3 is passed to the cat constructor
mini.knead()
  • subclass is a more specific version of a superclass
    • inherits all
    • class SubClass(SuperClass) inherits the superclass