Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c++ 面向对象的三大特性详解 — 封装、继承、多态 | Nature 的博客 #14

Open
NatureLan-sudo opened this issue Sep 20, 2022 · 0 comments

Comments

@NatureLan-sudo
Copy link
Owner

https://naturelan-sudo.github.io/2022/09/20/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E4%B8%89%E5%A4%A7%E7%89%B9%E6%80%A7%20%20%20%20-%20%20%20%202022-09-09/#more

面向对象:对象是指具体的某一个事物,这些事物的抽象就是类,类中包含数据(成员变量)和动作(成员方法)。 面向对象的三大特性: 封装: 将具体的实现过程和数据封装成一个函数,只能通过接口进行访问,降低耦合性。继承: 子类继承父类的特征和行为,子类有父类的非 private 方法或成员变量,子类可以对父类的方法进行重写,增强了类之间的耦合性,但是当父类中的成员变量、成员函数或者类本身被 final 关

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant