C++ Abstract Class: constructor yes or no?

后端 未结 8 1887
轮回少年
轮回少年 2020-12-04 08:45

A class with one (or more) virtual pure functions is abstract, and it can\'t be used to create a new object, so it doesn\'t have a constructor.

I\'m reading a book t

8条回答
  •  心在旅途
    2020-12-04 09:00

    firstName and lastName are private members, not accessible to Boss. All the interface to those has to be present in the Employee class, including initialization.

提交回复
热议问题