Search for tag: "getters"

Lesson 23.8 Properties (OPTIONAL)

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.…

From  Hannah Lee 31 plays

Lesson 23.1 The Principle of Abstraction

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…

From  Hannah Lee 83 plays

Lesson 22.8 Subclass Initializers

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…

From  Hannah Lee 68 plays

Lesson 22.3 The object 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.…

From  Hannah Lee 74 plays

Lesson 21.6 Immutable Attributes

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,…

From  Hannah Lee 87 plays

Lesson 21.5 Data Encapsulation

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…

From  Hannah Lee 97 plays