在很多文章中都说变量其实就是属性,但是它们之间有一定的区别,例如: 在全局作用域下, var a = "hello"; b = "hello"; 从字面上看,它们的区别是一个前面加了var,一个没有:它们的相同点都是全局的: 那么a称之为变量,只不过它是全局变量: b称之为属性,它是window对象的属性,因为在全局作用域下,浏览器默认会创建一个window对象,凡是通过全局定义的类似b = "hello",那么b称之为window对象的一个属性…
To enforce the ability of an object to hide its data, the compiler limits the scope of instance variables—that is, limits their visibility within the program. 为了强制一个对象隐藏其数据,编译器限制实例变量范围以限制其在程序中的可见性 But to provide flexibility, it also lets you explicit…