So far, we worked with different type of properties. When we declare stored instance properties with the
var keyword, we create a mutable instance property, which means that we can change their values for each new instance we create. When we create an instance of a class that defines many public-stored properties, we create a mutable object, which is an object that can change its state.
For example, let's think about a class named
MutableVector3D that represents a mutable 3D vector with three public-stored properties:
z. We can create a new
MutableVector3D instance and initialize the
z attributes. Then, we can call the
sum method with the delta values for
z as arguments. The delta values specify ...