|
This video introduces an advanced topic that is completely optional and will not appear on any exam. Classes like RGB and Point3 appear to enforce their invariants without any getters and setters.…
|
|
In this video we introduce the principle of abstraction, which is simply hiding unnecessary details about a class from the user of a class. However, there are many different ways to do that, which is…
|
|
In this video we show that thte primary purpose of the super function is in the initializer method of the subclass. That is because we cannot guarantee that all of the attributes for the parent class…
|
|
Every class must be a subclass of something, and that parent class goes inside of the parentheses. That means that the word object we have been using in all of class definitions is actually a class.…
|
|
Getters and setters have another advantage in that they allow us to completely disable to any changes to an attribute. This allows us to separate attributes into mutable and immutable attributes,…
|
|
In this previous video we introduced the concept of getters and setters. But how do we force the user to use these when the attribute is so much simpler. In this video we talk about the concept of…
|