单选题 C++
题号 #4238636

下列关于C++类的叙述中,错误的是(   )。

进入在线模考

参考答案

C

答案解析

友元机制允许一个类将对其非公有成员的访问权授予指定的函数或类,类和类之间可以互为友元关系,选项A正确;类代表某一种事物(对象)的共性和特征,用于描述事物的属性(数据成员)和对事物的操作(成员函数),选项B正确;类和类之间可以通过封装而具有相对独立性,选项D正确;类和类之
间的关系有:继承、实现、依赖、关联、组合、聚合等,选项c错误。本题答案为c选项。

你可能感兴趣的试题

A.int GetPrice( ){return price;}
A.int GetPrice( ){return price;}
A.int GetPrice( ){return price;}
B.int GetPrice( )const{return price;}
B.int GetPrice( )const{retum price;}
B.int GetPrice( )const{retum price;}
C.int Piano::GetPrice( ){return price;}
C.int Piano::GetPrice( ){return price;}
C.int Piano::GetPrice( ){return price;}
D.int Piano::GetPrice( )const{return price;}
D.int Piano::GetPrice( )const{retum price;}
D.int Piano::GetPrice( )const{retum price;}
找试题 · 找答案 · 找资料 在线模考