仍然不买构造函数初始化器的帐?
“构造函数”必须使用this来恰当地初始化对象属性。
The so-called "constructor" must use this to properly initialize the object's properties.
构造函数中除了使用简单的值对局部变量进行初始化之外,什么都不应该做。
Constructors should do no more than set the initial local variables to simple values.
构造函数通常应确保其每个数据成员都完成了初始化。
Constructors usually should ensure that every data member is initialized.
宝石类初始化(构造函数)是私人或公共方法方法?
Ruby class initialize (constructor) is private method or public method?
使用构造函数来初始化具有复杂逻辑的成员。
Use constructors to initialize members that require more sophisticated logic.
构造函数的工作是初始化对象。
构造函数的工作是初始化对象。
应用推荐