All mock tests are FREE till 31 December — register to save your progress
Unit 3 · Programming Concepts & Python HTET 2022 PGT Computer Science

Choose true statements about virtual functions in C++ :

I : The virtual functions must be member of some class.

II : They cannot be static members.

III: A virtual function can be a friend of another class.

C++ में वर्चुअल फलनों के बारे में सत्य कथनों का चुनाव कीजिए :

I : वर्चुअल फलन किसी क्लास के सदस्य फलन होने ही चाहिए।

II : वे स्टेटिक सदस्य नहीं हो सकते।

III: एक वर्चुअल फलन अन्य क्लास का मित्र फलन हो सकता है।

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. I, II and IIII, II तथा III

Explanation

All three are standard rules: a virtual function must be a member of some class, it cannot be a static member, and it can be declared a friend of another class.

तीनों नियम सही हैं: वर्चुअल फलन किसी क्लास का सदस्य होना चाहिए, स्टेटिक नहीं हो सकता और किसी अन्य क्लास का फ्रेंड हो सकता है।

More Programming Concepts & Python questions