@testHs’ statement is not accurate.
Dot syntax is used to access attribute access methods (getters and setters), setter方法显然是要传入参数的。方式为object.propertyName = something
You can do everything [] that dot syntax can do (not necessarily vice versa), but dot syntax is more convenient.
@testHs’ statement is not accurate.
Dot syntax is used to access attribute access methods (getters and setters),
setter
方法显然是要传入参数的。方式为object.propertyName = something
You can do everything [] that dot syntax can do (not necessarily vice versa), but dot syntax is more convenient.
Both are available.
When using [], you can pass parameters in, but when using ., you cannot pass parameters.