Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following is NOT a feature of C++ ?

  • A.Inheritance
  • B.Polymorphism
  • C.Encapsulation
  • D.Automatic Garbage Collection

Answer: D

Automatic garbage collection is not a feature of C++.

In C++, memory obtained with new must be released with delete, either by the programmer or automatically through destructors and smart pointers such as unique_ptr and shared_ptr (the RAII idiom). There is no run-time garbage collector that finds and frees unreachable objects, as there is in Java, C# and Python.

Inheritance, polymorphism and encapsulation are three of the pillars of object-oriented programming, and C++ supports all of them through classes, virtual functions and access specifiers.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.