Which of the following statement is true? If a base class declares a pure virtual function, a derived class must implement that function to become a concrete class. Referring to a derived-class object with a base- class handle is dangerous. A class is made abstract by declaring that class virtual. All virtual functions in an abstract base class must be declared as pure virtual functions.
Upstudy AI Solution
Answer
Solution
Answered by UpStudy AI and reviewed by a Professional Tutor


Bonus Knowledge
If a base class declares a pure virtual function, a derived class must implement that function to become a concrete class. This means that the derived class needs to provide an implementation for any pure virtual functions declared in its base class in order to be instantiated. Without this implementation, the derived class remains abstract, meaning you can’t create objects of that class. Referring to a derived-class object with a base-class handle is a common practice and allows for polymorphism. However, developers should be cautious about accessing derived-class-specific properties or methods, as this may lead to runtime errors if the derived class has additional characteristics not present in the base class. Always ensure proper type checks or use dynamic_cast to ensure safe casting!