When class members are labeled as private, they are inaccessible outside the class, enforcing _______.
- encapsulation
- abstraction
- polymorphism
- inheritance
Encapsulation is a key concept in object-oriented programming where the internal details of a class are hidden and only specific functionalities are exposed. Making class members private enforces this encapsulation.
Loading...
Related Quiz
- In what scenario might a weak_ptr be particularly useful to prevent?
- What is the primary purpose of using enum in C++?
- In a large-scale C++ project, two classes, Logger and FileHandler, are tightly coupled, sharing a lot of private data between them using friendship. How might you refactor these classes to reduce coupling without losing functionality?
- When a continue statement is encountered in a loop, the program control resumes from _______.
- The goto statement can only jump to labels within the same _______.