Class attributes
A class attribute is another form of a class member function. Its main task is to indirectly access data, the get block and set block definitions of the attribute must specify the data to be accessed. For automatic attributes, the compiler automatically creates the corresponding data fields and implements the get and set attributes.
Interface Properties
An interface can define attributes. An interface attribute can only have get or set blocks. If only set or get access is specified, this interface attribute indicates that, it only allows this type of access, which generates a constraint on the class implementation interface attribute, that is, when the class defines this interface attribute, the access permission cannot be greater than the permission specified in the interface. Although the class can supplement the set block or get block for this interface attribute, they cannot be defined as public. Note that no matter whether it is a function in an interface or an attribute in an interface, they are only interfaces. Therefore, for an attribute, it cannot implement get or set blocks.