What is abstract class in C++?

2023

What is abstract class in C++?

  1. A.

    Any class in C++ is an abstract class/Class from which any class is derived

  2. B.

    Class specifically used as a base class with at least one virtual function

  3. C.

    Class specifically used as a base class with at least one pure virtual function

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 235 students.

Show answer & explanation

Correct answer: C

An abstract class in C++ is a class that cannot be instantiated and is designed to be a base class. It must contain at least one pure virtual function, which is declared as = 0 in the function declaration. This makes the class abstract, and any derived class must implement all pure virtual functions to be instantiable.

हिन्दी उत्तर: C++ में एक अमूर्त क्लास वह क्लास होती है जिसे इंस्टेंस नहीं किया जा सकता है और यह एक बेस क्लास के रूप में डिज़ाइन की जाती है। इसमें कम से कम एक प्यूर वर्चुअल फंक्शन होना चाहिए, जिसे फंक्शन डिक्लेरेशन में = 0 के रूप में घोषित किया जाता है। इससे क्लास अमूर्त बन जाती है, और किसी भी व्युत्पन्न क्लास को इंस्टेंसिएबल बनाने के लिए सभी प्यूर वर्चुअल फंक्शन्स को इम्प्लीमेंट करना होता है।

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs