有如下类和对象的定义: class Constants{ public: static double get PI(){return 3.

13 查阅

有如下类和对象的定义: class Constants{ public: static double get PI(){return 3.1416;} }; Constants constants; 下列各组语句中,能输出3.1416的是

A.cout<<constants->getPI();和cout<<Constants::getPI();

B.cout<<constants. getPI();和cout<<Constants.getPI();

C.cout<<constants->getPI();和cout<<Constants->getPl();

D.cout<<constants. getPI();和cout<<Constants::getPI();

参考答案:

D

计算机二级