基类/派生类同名成员和protected访问范围说明符

Loading...
Peking University
4.8 (752 ratings) | 34K Students Enrolled
View Syllabus

Reviews

4.8 (752 ratings)
  • 5 stars
    633 ratings
  • 4 stars
    81 ratings
  • 3 stars
    22 ratings
  • 2 stars
    8 ratings
  • 1 star
    8 ratings
HX

Mar 17, 2016

Challenging but highly recommended if you really want to learn something serious about C++.

RX

Oct 22, 2017

Excellent course! Teachers are humorous and good at logical teaching.

From the lesson
继承与派生
代码重用是提高软件开发效率的重要手段,因此C++对代码重用有很强的支持,继承与派生就是支持代码重用的机制之一。例如,要编写一个学生管理程序,必然要设计一个“学生”类,“学生”类会包含学生共有的姓名、学号等属性,但是中学生、大学生、研究生又有各自不同的属性和方法,如果为每种学生单独编写一个类会造成重复与浪费。本模块将介绍通过继承和派生机制,可以在基类的基础上派生出不同的类,从而达到代码重用的目的。

Taught By

  • Jiaying Liu 刘家瑛, Ph.D.

    Jiaying Liu 刘家瑛, Ph.D.

    Associate Professor
  • 郭 炜

    郭 炜

    讲师

Explore our Catalog

Join for free and get personalized recommendations, updates and offers.