--:--









Quiz for Abstract classes and pure virtual functions

Course: C++ Language | Subject: Unit 6 | Topic: Inheritance



Logo

Q1: What is an abstract class in C++?

Logo

Q2: How do you declare a pure virtual function?

Logo

Q3: Can you create an object of an abstract class?

Logo

Q4: What must a derived class do if it inherits from an abstract class?

Logo

Q5: What happens if a derived class does not override all pure virtual functions?

Logo

Q6: Can an abstract class have constructors?

Logo

Q7: Can abstract classes have non-pure virtual functions?

Logo

Q8: Is it possible to define a body for a pure virtual function?

Logo

Q9: What is the role of an abstract class?

Logo

Q10: Can abstract classes be used as base classes?

Logo

Q11: Which of these is true about abstract classes?

Logo

Q12: What keyword is used to declare a pure virtual function?

Logo

Q13: What will happen if a class has no pure virtual functions?

Logo

Q14: Can a class have multiple pure virtual functions?

Logo

Q15: How does an abstract class differ from an interface in C++?

Logo

Q16: What is a common use case of abstract classes?

Logo

Q17: If a derived class overrides a pure virtual function, what is the effect?

Logo

Q18: Can an abstract class be instantiated via a pointer or reference?

Logo

Q19: What is required to instantiate a concrete class derived from an abstract class?

Are you ready to start test? Set your time limit