The name of the constructor method is the same as the class name, and there is no return value type. The main function of the constructor is to perform some initialization operations when creating an object, such as assigning initial values to member properties.
For the attributes of the class, we access and set them through the get and set accessors to ensure the security of the data in the class.
Accessors are divided into the following three types:
Write-only attributes: only include set accessors.
Read-only attribute: only contains get accessor.
Read-write properties: include both set accessor and get accessor.