Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 5 MCQs Dynamic Memory Management and Polymorphism

CSE202 — Object Oriented Programming 50 questions. Pick an option to check it.

Read the notes

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    Which operator is used in C++ to allocate memory dynamically at runtime?

  2. Question 2 of 50

    Which operator is used to release memory previously allocated by 'new'?

  3. Question 3 of 50

    What happens if the 'new' operator fails to allocate memory?

  4. Question 4 of 50

    Which syntax is correct for dynamically allocating an array of 10 integers?

  5. Question 5 of 50

    How do you correctly deallocate an array allocated with 'new int[10]'?

  6. Question 6 of 50

    Where is memory allocated when using the 'new' operator?

  7. Question 7 of 50

    What is a memory leak?

  8. Question 8 of 50

    What is the return type of the 'new' operator?

  9. Question 9 of 50

    Is it safe to use 'delete' on a NULL pointer?

  10. Question 10 of 50

    What is Compile-time Polymorphism also known as?

  11. Question 11 of 50

    Which of the following is an example of Compile-time Polymorphism?

  12. Question 12 of 50

    Which keyword is used to enable Run-time Polymorphism in C++?

  13. Question 13 of 50

    What is 'Early Binding'?

  14. Question 14 of 50

    What is 'Late Binding'?

  15. Question 15 of 50

    Which mechanism does C++ use to implement Late Binding?

  16. Question 16 of 50

    Can a C++ constructor be declared 'virtual'?

  17. Question 17 of 50

    What is a Virtual Destructor used for?

  18. Question 18 of 50

    What is a Pure Virtual Function?

  19. Question 19 of 50

    A class containing at least one pure virtual function is called:

  20. Question 20 of 50

    Can you instantiate an object of an Abstract Class?

  21. Question 21 of 50

    What is a Concrete Class?

  22. Question 22 of 50

    What is a Self-Referential Class?

  23. Question 23 of 50

    Why can't a class contain an object of itself as a member variable?

  24. Question 24 of 50

    What is a Dynamic Constructor?

  25. Question 25 of 50

    If a class uses dynamic memory allocation in its constructor, what should usually be implemented?

  26. Question 26 of 50

    What is the syntax to declare a pure virtual function?

  27. Question 27 of 50

    If a derived class does not override a pure virtual function from the base class:

  28. Question 28 of 50

    Which pointer is used implicitly to access the object's members inside a member function?

  29. Question 29 of 50

    Function overriding requires which of the following?

  30. Question 30 of 50

    Which operator cannot be overloaded?

  31. Question 31 of 50

    When is the memory allocated for a static data member?

  32. Question 32 of 50

    Which of the following best describes a memory allocation failure handling method?

  33. Question 33 of 50

    In C++, polymorphism is mainly divided into:

  34. Question 34 of 50

    If you have a pointer 'Base *b = new Derived();', which function is called for 'b->show()' if show is NOT virtual?

  35. Question 35 of 50

    If you have a pointer 'Base *b = new Derived();', which function is called for 'b->show()' if show IS virtual?

  36. Question 36 of 50

    What is the overhead of using virtual functions?

  37. Question 37 of 50

    Which data structure is typically used to implement a Self-Referential class?

  38. Question 38 of 50

    Can a static member function be virtual?

  39. Question 39 of 50

    Which of the following creates an object in the stack?

  40. Question 40 of 50

    What is 'dangling pointer'?

  41. Question 41 of 50

    The mechanism of selecting the appropriate function at compile time is based on:

  42. Question 42 of 50

    What is the role of the vptr (virtual pointer)?

  43. Question 43 of 50

    Deep copy is recommended over shallow copy when:

  44. Question 44 of 50

    In C++, an interface is best simulated by:

  45. Question 45 of 50

    If a destructor is virtual in the base class, is it automatically virtual in the derived class?

  46. Question 46 of 50

    Which operator is used to access members of a class using a pointer to an object?

  47. Question 47 of 50

    What happens if you forget [] when deleting an array of objects?

  48. Question 48 of 50

    Can friend functions be virtual?

  49. Question 49 of 50

    Dynamic binding typically reduces execution speed slightly because:

  50. Question 50 of 50

    To prevent a class from being inherited, C++11 introduced which keyword?

That's unit 5

Answer a few questions and your score shows up here.