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)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Beginning Scala study note(7) Trait

    A trait provides code reusability in Scala by encapsulating method and state and then offing possibi ...

  4. Beginning Scala study note(6) Scala Collections

    Scala's object-oriented collections support mutable and immutable type hierarchies. Also support fun ...

  5. Beginning Scala study note(5) Pattern Matching

    The basic functional cornerstones of Scala: immutable data types, passing of functions as parameters ...

  6. Beginning Scala study note(4) Functional Programming in Scala

    1. Functional programming treats computation as the evaluation of mathematical and avoids state and ...

  7. Beginning Scala study note(3) Object Orientation in Scala

    1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...

  8. 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 ...

  9. TestNG Study Note 1 - Eclipse 插件安装

    TestNG 插件在线安装 Help -> Install New Software -> Add -> Paste TestNG url to Add:  http://testn ...

  10. CCJ PRML Study Note - Chapter 1.6 : Information Theory

    Chapter 1.6 : Information Theory     Chapter 1.6 : Information Theory Christopher M. Bishop, PRML, C ...

随机推荐

  1. regeneratorRuntime未定义

    babel-preset-stage-2 { "presets": ["es2015", "stage-2"], "plugins ...

  2. php常用函数file

    fopen:(创建并)打开一个文件或url地址. 模式 说明 r 只读,将将文件指针指向文件开始位置 r+ 读写,将文件指针指向文件开始位置 w 只写,将文件指针指向文件开始位置将将文件内容清空,如果 ...

  3. spring @condition 注解

    spring @condition注解是用来在不同条件下注入不同实现的 demo如下: package com.foreveross.service.weixin.test.condition; im ...

  4. 了解FreeRTOS源文件目录结构

    参考文献: Understanding the FreeRTOS directory structure. 从官网下载下来的FreeRTOS源文件包,对于每一个已经移植完成的处理器,都有一个与之对应的 ...

  5. android屏幕适配原则

    1.尽量使用线性布局和相对布局 2.尽量使用dip和sp,不要使用px 3.为不同的分辨率提供不同的布局文件和图片 4.在AndroidMainfest.xml中设置多分辨率支持 5.层级嵌套,合理布 ...

  6. mkforsela

    -- #!/bin/bash #sela.gao # #History: # .根据每行查找出来的结果push进去手机 #result: # :没有编译生成文件 # :没有设置编译环境 echoMsg ...

  7. Excel-漏斗图分析(差异分析)

    漏斗图适用于业务流程比较规范.周期长.环节多的流程分析,通过漏斗各环节业务数据的比较,能够直观地发现和说明问题所在.在网站分析中,通常用于转化率比较,它不仅能展示用户从进入网站到实现购买的最终转化率, ...

  8. ubuntu一些常用的命令

    1.docker里的ubuntu不知道密码,更新密码 sudo passwd 2.解压zip文件 unzip xx.zip 3.安装LAMP (1)sudo apt-get install apach ...

  9. Android 基础概念了解

    Android 的前世今生Android 系统框架Android 主要组成 部分Android 常用的操作 Android 的前世今生 Android 的诞生 2003年10月,有"Andr ...

  10. js 不同进制之间相互转换

    如果a进制与b进制都不等于10,则十进制作为桥梁进行转换 例如 10进制的数字11 转换为3进制为102 10进制的数字11 转换为4进制为23 现在进行3进制转4进制 1.3进制转10进制 2.10 ...