C++ OOP Concept1错题

(1)How structures and classes in C++ differ?

 A:Structure members are public by default whereas, class members are private by default. Both of them can have private and public members.

(2)Which of the following shows multiple inheritances?

A:In multiple inheritance, a single class is inherited from two classes. So in A,B->C, Class C is inherited from A and B, whereas in A->B->C, C from B and B from A called simple inheritance, in A->B; A->C, B and C are inherited from A which is called hierarchical inheritance.

(3)C++ is

A:C++ supports both procedural(step by step instruction) and object oriented programming(using concept of classes and objects).

(4)What does modularity mean?

A:Modularity means dividing a program into independent sub programs so that it can be invoked from other parts of the same program or any other program.

总结:真的没有想到自己的基础会这么不扎实,还是要多多刷题才行呀~

题目出处:https://www.sanfoundry.com/cplusplus-programming-questions-answers-oops-concept-1/

原文地址:https://www.cnblogs.com/hhlys/p/13035551.html