Abstract Classes and Interfaces – MCQs

30 Score: 0 Attempted: 0/30 Subscribe
1. : What is the purpose of an abstract class?





2. : Which of the following cannot be instantiated?





3. : Which keyword is used to define an abstract class in C++?





4. : What must a class contain to be considered abstract in C++?





5. : An abstract class is primarily used to:





6. : Interfaces in object-oriented programming represent:





7. : Which of the following can be part of an interface?





8. : In C++, an interface is typically represented as:





9. : Abstract classes can have:





10. : Which of the following is true for an interface?





11. : What does a pure virtual function end with in C++?





12. : Interfaces are useful because they enable:





13. : Why can’t you create an object of an abstract class?





14. : Which one is not a feature of abstract classes?





15. : When a class inherits from an abstract class, it must:





16. : An interface can be considered as:





17. : What happens if a derived class doesn’t implement all pure virtual functions of the base class?





18. : Which class type is commonly used as a base for polymorphic behavior?





19. : An abstract class can:





20. : The main advantage of using interfaces is:





21. : What is required in C++ to create an interface-like structure?





22. : Can abstract classes have constructors?





23. : What kind of function must be present in an abstract class in C++?





24. : Interfaces help in:





25. : What is not allowed in an interface?





26. : Which feature makes polymorphism possible using abstract classes?





27. : If a class inherits from multiple interfaces, this is called:





28. : Can abstract classes be inherited?





29. : What happens when an object of a class implementing an interface is created?





30. : Abstract classes promote:





Leave a Comment

All copyrights Reserved by MCQsAnswers.com - Powered By T4Tutorials