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
- In context of C++, which of the following is a valid statement ?
- In C file handling equivalent to scanf("%d",&val); is :
- A variable declared within the block {} has the following scope :
- What is a copy constructor ?
- In the given declaration of an array : float height[50];
- The functions 'cin' and 'cout' resolve the necessary conversions at :