C plus plus study note (one)
What is an object ?
Object = Entity ;
Object may be
- -- visible or
- -- invisible
Object is variable in programming languages.
Objects = Attributes + Services
What is Object-oriented
A way to organize
- Designs
- Implementations
Objects send messages
Messages are
- -Composed by the sender
- -Interpreted by the receiver
- -Implemented by methods
Messages
- May cause receiver to changer state
- May return results
Object vs. Class
OOP characteristics
- A program is a bunch of objects telling each other what to do 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.
The Hidden Implementation
Inner part of an object, data members to present its state, and the actions it takes when messages is rcvd is hidden.
Class creators vs. Client programmers
-keep client programmers' hands off portions they should not touch
-Allow the class creators to change the internal working of the class without worrying about how it will affect the client programmers.
Encapsulation
Bundle data and methods dealing with these data together in an object.
Hide the details of the data and the action.
Restrict only access to the publicized methods.
C plus plus study note (one)的更多相关文章
- Beginning Scala study note(9) Scala and Java Interoperability
1. Translating Java Classes to Scala Classes Example 1: # a class declaration in Java public class B ...
- Beginning Scala study note(8) Scala Type System
1. Unified Type System Scala has a unified type system, enclosed by the type Any at the top of the h ...
- Beginning Scala study note(7) Trait
A trait provides code reusability in Scala by encapsulating method and state and then offing possibi ...
- Beginning Scala study note(6) Scala Collections
Scala's object-oriented collections support mutable and immutable type hierarchies. Also support fun ...
- Beginning Scala study note(5) Pattern Matching
The basic functional cornerstones of Scala: immutable data types, passing of functions as parameters ...
- Beginning Scala study note(4) Functional Programming in Scala
1. Functional programming treats computation as the evaluation of mathematical and avoids state and ...
- Beginning Scala study note(3) Object Orientation in Scala
1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...
- Beginning Scala study note(2) Basics of Scala
1. Variables (1) Three ways to define variables: 1) val refers to define an immutable variable; scal ...
- TestNG Study Note 1 - Eclipse 插件安装
TestNG 插件在线安装 Help -> Install New Software -> Add -> Paste TestNG url to Add: http://testn ...
- CCJ PRML Study Note - Chapter 1.6 : Information Theory
Chapter 1.6 : Information Theory Chapter 1.6 : Information Theory Christopher M. Bishop, PRML, C ...
随机推荐
- Autumn is a second spring when every leaf is a flower.
Autumn is a second spring when every leaf is a flower. 秋天即是第二个春天,每片叶子都是花朵.——阿尔贝·加缪
- 反射 __import__
__import__ 根据字符串导入模块 def run(): inp = input('请输入URL:') m,p = inp.split('/') obj = __import__(m) if h ...
- 机器人操作臂运动学入门一--D-H参数标定
最近重新学习机器人方面的知识,想到一年以前在学校选修<机器人学技术基础>这门课的时候,老师虽然讲机器人的各个方面的知识都讲到了,但只是浮光绿影的的提到,并没有真正讲到深处,我的理解也没有更 ...
- 【转】eclipse luna 无法安装veloeclipse问题
转载地址:https://code.google.com/p/veloeclipse/issues/detail?id=47 I tried to install veloeclipse 2.0.8 ...
- 初学者-ASCII码 数字转字母
var index=1; var byt = new byte[1] {(byte) (index + 64)}; var grade = Encoding.ASCII.GetString(byt); ...
- webstorm2016.2 for mac 安装
文件来自斯蒂芬周: http://www.sdifenzhou.com/?p=6941&jdfwkey=jmnzy 附上详细安装步骤:
- easyUI的Dialog和Windows框的应用
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- Unbuntu下使用SVN
一.查看SVN版本 svn --version 二.查看SVN仓库 # 查看被svn仓库占用的所有端口 netstat -anp |grep svn # 查看所有端口对应的仓库 ps -ef | gr ...
- 屏幕监视专家 v1.0 定时录制屏幕动画发送到指定邮箱
ScreenWatcher v1.0功能:定时录制屏幕动画发送到指定邮箱,录制的动画为gif,可指定录制多长时间.指定几点直接开始录制,完全后台运行.作者:Bluefish 下载链接: http:// ...
- 【前端】原生event对象和jquery event对象的区别
标准DOM event对象转换成 jQuery event对象 $(event) jQuery event对象转换成 标准DOM event对象 event.originalEvent