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 ...
随机推荐
- 删除Management Data Warehouse (MDW) job失败
转:http://lzf328.blog.51cto.com/1196996/1349670 最近在清理一些不用的Job,发现几个跟MDW有关的.虽然Job已经被Disable, 但是没有被删除.尝试 ...
- 修改tnsnames.ora文件中配置内容中的连接别名后,连接超时解决办法
1.tnsnames.ora文件中配置内容中的连接别名:由upaydb修改为IP地址 2.连接超时 定位原因: PLSQL登录界面的数据库列表就是读的tnsname.ora中连接的别名,这个文件中连接 ...
- mysql 日志表rename 备份
1. 按照原历史表新增一个新表(空表): mysql> create table history_log_new ...; 2. 给历史表重命名,并将新表重命名为历史表: mysql> R ...
- base64与byte[]之间转换
主要是根据BASE64Encoder 和BASE64Decoder 进行操作实现,具体例子如下: BASE64Encoder encode = new BASE64Encoder(); //将byte ...
- css新笔记
这里的黑科技其实就是一些CSS中不怎么为人所知但在解决某些问题的时候很溜的属性. border-radius 很多开发者估计都没有正确认识这个border-radius,因为基本上很多人都是这么用的: ...
- Organize Your Train part II-POJ3007模拟
Organize Your Train part II Time Limit: 1000MS Memory Limit: 65536K Description RJ Freight, a Japane ...
- linux常用命令汇总
1. 文件及文件夹操作 1.1 修改文件名 mv abc ab 把文件名abc改为ab. 1.2 删除文件和文件夹 rm abc rm -rf abc 1.3 拷贝文件夹 格式: CP [选项] 源 ...
- 上传图片shell绕过过滤的几种方法
一般网站图片上传功能都对文件进行过滤,防止webshelll写入.但不同的程序对过滤也不一样,如何突破过滤继续上传? 本文总结了七种方法,可以突破! 1.文件头+GIF89a法.(php)//这个很好 ...
- webpack的简单使用
今天简单的说一下webpack的使用. 打开cmd(也可以用别的看个人爱好) 打开你要创建项目的文件夹: webpack安装: 1.全局安装webpack:$npm install webpack - ...
- background-position (转)
http://blog.csdn.net/JeamKing/article/details/5617088 注:这是别人博客链接地址 具体效果图片可以查看此链接 语法:background-po ...