essential c++ book note 4 chapter 5

chapter 5

object-oriented programming 

2 primary characteristics of object-oriented programming are Inheritance and Polymorphism

Inheritance: allows us to group classes into families of related types, allowing for the sharing of common operations and data.

Polymorphism: allows us to program these families as a unit rather than as individual classes.

the parent is called base class and child is called derived class 

 

1---in object-oriented programming, we indirectly manipulate the class objects through pointers or reference.(add or remove a derived class without the need for any modification to existing program)

void loan_check_in(LibMat &mat)   // no LibMat object in our application
{
   mat.check_in();   // mat refers to an actual object 
}

2 -- 

转载于:https://www.cnblogs.com/ggppwx/archive/2011/01/16/1936555.html

评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值