下面是对类 MyClass 的定义,对定义中语句描述正确的是( )。 class MyClass { public: void MyClass(int a) {X=a;} // 1 int f(int a,int b) // 2 { X=a; Y=b; } int f(int a,int b,int c=0) // 3 { X=a; Y=b; Z=c; } static void g() {X=10;} // 4 private: int X,Y,Z; };
A.
语句①是类 MyClass 的构造函数定义
B.
语句②是类和语句③实现类成员函数的重载
C.
语句④实现对类成员变量 X 的更新操作
D.
语句①、②、③和④都不正确
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】Regarding decision making, when the number of alternatives a manager must identify is so great and the amount of information so vast that it is difficult for the manager to even come close to evaluati...
【简答题】___________, I'll give you some basic information about DCV Fashions. ________, I'll explain why we've been so successful in the fashion industry. ________, I'll tell you about our mission statement. ...
【简答题】13,Are you someone who finds the riskand ______of the stock market stomach-turning? If this describes your personality, you are a prime candidate for mutual funds.
【单选题】The objective of rebounding is to successfully gain possession of the basketball after a missed field goal or free throw, as it rebounds from the hoop or backboard.This describes which technique?