This is a premium course. To view and assign premium course, you must upgrade your account
A Class is a custom data type. Classes can represent more complex data than integers or strings.
Classes, in addition to holding several properties, can also contain methods
A private method is one which can only be used within the Class where it is defined
A public method is one that is available to processes outside of the Class itself
Getter methods are public methods that allow users to read the value of private class members without offering them the ability to overwrite these values
Setters are public access methods that allow users to write to private property fields. These may come with protections to prevent users from writing invalid data
Mutators are methods that change the value of the object they are called on
For the next few lessons, we will be making a complex number class to illustrate the concepts we've learned
Adding arithmetic computations to our Cnum class
A copy constructor allows you to duplicate an object by passing it into the constructor of the same class. In this lesson we will pass a Cnum to a new Cnum in order to make a duplicate of the original.
Static Class methods let us call methods directly on the Class, rather than on a specific Object of the Class