# Classes and Objects
English
The object-oriented programming takes everything as an object. The world is composed of objects. An object can be a computer, a person, or an intangible thing, such as a bank account. A program is a bunch of objects telling each other what to do by sending messages.
面向对象编程将一切事物视作对象。这个世界就是对象的组合。一个对象可以是一台计算机,一个人,或者一个不真实的事物,比如一个银行账号。一个程序是多个对象组成的,对象之间通过发送消息来告诉彼此要做什么。
English
An object has state, behavior and identity. This means that an object can have internal data. An object can also have methods. Each object can be uniquely distinguished from others by its identity, such as a name. Each object occupies a unique storage location.
一个对象拥有状态,行为和标识。这意味着一个对象拥有内部的数据。一个对象也可以有方法。每个对象都是唯一的可以通过标识区分的,就像一个名字。每个对象都占用唯一的存储位置。
English
Abstraction is an important property of all object oriented programming language. The same types of objects have the same properties, so we can extract the similar features from those objects. This approach is called abstraction. The concept of abstraction is to describe a set of similar concrete entities. For instance, as a whole, a car is asingle object, in detail, the car consists of several subsystems: steering, brake, sound system, airconditioning and so on. In turn, each of these subsystems is made up of more specialized units.
抽象是所有面向对象编程语言中的重要属性。同类型的对象拥有相同的属性,因此我们可以从这些对象中提取相似的特征。这种方法被称为抽象。抽象类的概念是用来描述一组相似的具体实体。例如,整体上,汽车是一个单一的对象,细节上,汽车包含多个子系统:转向系统、刹车系统、音响系统,空调系统等。相应的,这些子系统中的每一个又由更专门的单元组成。
English
Methods within the same class taking the same name but differing in arguments are termed overloaded methods.
同一类中具有相同名称但参数不同的方法称为重载方法。