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. c++ 面试注意的问题

    1.输入数据合法性检查 2.变量命名 3.边界数据的检查 4.函数名,递归的思想[尤其是树.链表] 企业喜欢的人:聪明 努力 基础好 面试时不要主动请求提示,做题要大胆地想,及时与面试官沟通,防止想很 ...

  2. iOS中什么是superView?(新手概念简述版)

    文/司马陶冶(简书作者)/文章有删改原文链接:http://www.jianshu.com/p/8537dac37852 著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. 在iPhone ...

  3. Java Web学习路线

    2016-08-22的早上,本是一个很平静的早上,坐在去往公司的公交车上想到了很多之前上学时的点点滴滴,回想起来还真的是耐人寻味啊,当初青春的懵懂,当初的冲动,当初的做事不考虑后果! 也正是这耐人寻味 ...

  4. Windows7+32位,MongoDB安装

    在网上找了各种安装MongoDB的教程,总是会出现一些bug,就自己总结了,亲测正确,MongoDB的安装再也不是一件麻烦的事情了~ 1.下载好跟自己电脑适合的安装包,选择Custom自定义安装,将安 ...

  5. Css样式基础

    1.Css的语法 CSS的语法主要由两个部分组成,一个是选择器,一个是属性. 选择器又分为以下几种: 1.元素选择器:即Html标签去掉括号的就是元素 2.类选择器:所谓的类就是说class=“名称” ...

  6. Boostrap

    基本认知: Boostrap绝对是目前最流行用得最广泛的一款框架.它是一套优美,直观并且给力的web设计工具包,可以用来开发跨浏览器兼容并且美观大气的页面. Bootstrap的优缺点: 缺点: 1. ...

  7. Codeforces617 E . XOR and Favorite Number(莫队算法)

    XOR and Favorite Number time limit per test: 4 seconds memory limit per test: 256 megabytes input: s ...

  8. iOS高性能设置圆角

    自建一个分类可以设置. -(void)cornerImageWithSize:(CGSize)size fillColor:(UIColor *)fillColor completion:(void( ...

  9. 一看便知spring+quartz定时任务

    这是我经过网上收集然后加上自己的测试写的,以便大家使用 标配:已测 注意需要的包:(在已经配置spring 的情况下) quartz-all-1.6.jar        spring-context ...

  10. CSS篇

    一.盒子模型: 标准模式和混杂模式(IE).在标准模式下浏览器按照规范呈现页面:在混杂模式下,页面以一种比较宽松的向后兼容的方式显示.混杂模式通常模拟老式浏览器的行为以防止老站点无法工作. CSS盒子 ...