And sometimes they add letters. For instance, they might call the nearby Patapsco River the "Patapsico."
VOA: special.2011.03.07
Right that's a specific name, and what it basically says is, when I call the class instance.
好这是个特定的应用,它的意思也就是,让我调用一个类的实例。
Or another way of thinking about it, is remember I said when I call that class definition it creates an instance, that's a pointer to some spot in memory that's got some local information around it.
也就是一个指向,内存中某处的指针,这个地方存有一些,这个实例的信息,浅意义的相等也就是说,看看这两个东西是不是。
this is an idea that ; I got from the Milton lecture that I took when I was a sophomore here; - my professor suggested that this is an instance of what -- Freud would call the return of the repressed.
这是一个想法,是我大二的时候从一个弥尔顿的演讲上学到的;,我的教授说这是一个例子-,即弗洛伊德所谓的压抑归来。
So, you assign values to very specific states of matter and call those the reference points for your temperature. For instance, freezing of water or boiling of water, the standard ones.
那么你对物质的,某些特殊状态指定数值,把它们叫做你的温度的参考点,比如水的冰点或沸点,它们都是标准。
And when you call a function, one of the things X that happens is whatever your passing in, for instance, X, ; and if this is A, this thing gets copied into A; so at that moment in time of calling increment, I actually have two copies of the same value in memory but they're referred to by different names.
当你调用一个函数,其中发生的一件事情是,不管你输入什么,比如,或者是A,它把这个东西复制到A中;,调用increment的时候,实际上在内存中,有两个同样的值的内存块,但是它们有不同的名字。
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.
一个人仅仅可以访问实例变量,或者,我们可以这么来说,通过定义好的方法,来访问实例的变量。
For now the way to think about this is, cp2 when I call that class definition, it goes off and allocates a specific spot in memory that corresponds to that instance.
这个语句所做的,就是建立了,这个类型的实例cp1和,这个类型的特定版本,现在你们可以这么认为。
When we call init, it's going to create the instance, all right, just as we said before.
好,正如我们前面所受的,但是尤其是,它会去用self来引用这个实例。
应用推荐