面向对象(object-oriented
)程序设计
1
IDE的功能
2
- 关注的是对象,不是流程
- 对象可以是任何东西
- 面向对象既适用于设计,也适用于实现
- 对象里封装着方法,通过接口调用,即对象等于数据和包装数据的操作
- 对象之间交互的形式是消息
Objects send message
- Messages are:1.Composed by the sender 2.Interpreted by the receiver 3.Implemented by methods
- Messages may cause receiver to change state
- Messages may return results
- Class defines Object -------Object is a Class -------- cat and cat class
- OOP Characteristics
Q:Are Messages Objects? Are Outputs Objects?
OOP Characteristics
- Everything is an object
- A program is a bunch of objects telling each other what to so by sending messages
- Each object has its own memory made up of other objects
- Every object has a type
All objects of a particular type can receive the same messages