您的位置:首页 > 编程语言 > C语言/C++

C++之 什么是对象

2014-11-01 21:12 120 查看
What is an object?

object=entity

objects=attributes+services

Data: the properties or status < Operations: the functions

Mapping

From the problem space to the solution one.

C++ version:

class Point3d{

public:

Point3d(float x,float y,float z);

print();

private:

float x;

float y;

float z;

};

Point3d a(1,2,3);

a.print();


What is object-oriented

A way to organize

Designs

Implementations

Objects,not control or data flow, are the primary focus of the design and implementation

To focus on things,not operations.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: