Q6.Marks: +2.0UGC NET Paper 2: Computer Science 2nd January 2026 Shift 1
Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R Assertion A: We can build an object from a class containing a pure virtual function. Reason R: A class containing a pure virtual function is called an abstract class.
In the light of the above statements, choose the most appropriate answer from the options given below
1.Both A and R are correct and R is the correct explanation of A
2.Both A and R are correct but R is NOT the correct explanation of A
3.A is correct but R is not correct
4.A is not correct but R is correct✓ Correct
Solution
The correct answer is A is not correct but R is correct.
Key Points
A class containing a pure virtual function is referred to as an abstract class.
An abstract class cannot be instantiated directly. In other words, we cannot create an object of a class that contains at least one pure virtual function.
The purpose of an abstract class is to serve as a base class for other derived classes that implement the pure virtual functions.
Assertion A is incorrect because a pure virtual function prevents the instantiation of the class, making it impossible to build an object from such a class.
Reason R is correct because it accurately defines what an abstract class is, which is a class containing at least one pure virtual function.
Additional Information
Pure Virtual Functions:
A pure virtual function is a virtual function that is declared by assigning it to 0 in its declaration (e.g., virtual void func() = 0;).
It serves as a placeholder for derived classes to provide their specific implementation of the function.
Classes that contain pure virtual functions are abstract and cannot be instantiated directly.
Characteristics of Abstract Classes:
They can have both pure virtual functions and normal member functions.
Derived classes must override all pure virtual functions of the base class to become concrete classes (non-abstract).
If a derived class does not override all pure virtual functions, it also becomes an abstract class.
Example:
Consider the following code snippet:
class AbstractClass {
virtual void pureFunction() = 0; // Pure virtual function
};
class ConcreteClass : public AbstractClass {
void pureFunction() override {
// Implementation
}
};
Here, AbstractClass is an abstract class, and ConcreteClass provides an implementation of the pure virtual function, making it a concrete class.
Important Points:
An abstract class can have constructors, destructors, and member variables.
Abstract classes are used to define interfaces or base functionality for derived classes.
They enable polymorphism, allowing derived classes to provide specific implementations of base class functions.