One of the main ways to keep your project code manageable is to prevent unnecessary repetition. In this video, create test code in DartPad to test class inheritance.
- [Instructor] Now that we've already talked … about abstraction and encapsulation … and seen it in action, let's move onto the next … pillar of OOP, which is inheritance. … And inheritance, when we're talking about it in programming, … refers to when a class is able … to inherit properties and methods from their parents. … So you, for example, might have inherited … your eye color from your parents, … or you might have inherited certain behaviors, … like you are a neat freak and you really really need … to keep everything super tidy, … you might have gotten that from your mum or your dad. … Similarly, our classes can inherit … from a superclass, or a parent class, … and it can inherit properties as well as methods. … And this is important because when we're abstracting … our program and we're creating lots of different modules, … lots of different components that all take care … of a specific task, it's likely that we will have … some duplication in their functionality. … So for example, our pastry chef and our chef will …
This course was created by London App Brewery. We are pleased to host this content in our library.