Code.org Key Learning
Code.org Key Learning from Week2
Lesson 10
Inheritance: This code syntax shows how to create a new Child class that inherits from a parents class. All the methods and attributes can now be used in the new child class.
The extends keyword shows that the new PainterPlus class inherits from the original Painter class. This means that it inherits all of its properties and methods, and that these methods can be used in the new class.
PainterPlus.java
MyNeighborhood.java
Methods
Lesson 14
PainterPlus.java
PainterPlus extends everything from the Painter parent class.
PatternPainter.java
PatternPainter inherits from the PainterPlus class. Since PainterPlus inherits from Painter, PatternPainter will be able to use both PainterPlus and Painter methods and attributes.
BackgroundPainter.java
BackgroundPainter goes even further and extends from PatternPainter, meaning it can use methods from PatternPainter as well as PainterPlus and Painter.
Check For Understanding
Taco extending food is the only one that represents a class inheritance example because Taco is a subclass of Food.