Examly題庫立即開始練習
地方政府公務人員四等-電子工程類科計算機概要11024單選題

下列的 C++程式中,未使用下列何種技術?#include <iostream> using namespace std; class A { private: int x; public: int y; int get(void) {return x;} }; class B : A { public: int get(void) {return y+2;} }; int main() { }

Ainheritance
Bencapsulation
Coverriding
Dtemplate正確答案
答案與詳解
D
正確答案
程式用了繼承、封裝、覆寫,但沒有用到 template(泛型模板)技術。

為什麼答案是 D

template(樣板/泛型)需使用 template<class T> 或 template<typename T> 語法定義泛型類別或函式。本程式完全沒有此語法,故未使用 template 技術,為正解。

考點:繼承考點:封裝考點:覆寫考點:樣板
載入中…

計算機概要 相關題目

想練更多計算機概要考古題?

Examly 收錄 38 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。

Download on theApp Store即將推出Google Play
黑皮