在类的声明中,属性是用变量来表示的。这种变量就称为实例变量,是在类声明的内部但是在类的其他成员方法之外声明的。类的每个对象维护它自己的一份实例变量的副本。
动作方法把实例变量拷贝到视图。
The action method copies any instance variables to the view.
问题出在拥有少量实例变量的类上。
The issue is for classes that have a small number of instance variables.
只能把简单的常量值赋给实例变量。
The only values you can assign to an instance variable are simple constants.
I think of data hiding as basically saying, one can only access instance values, or, we'll call them that, instance values through defined methods.
一个人仅仅可以访问实例变量,或者,我们可以这么来说,通过定义好的方法,来访问实例的变量。
应用推荐