What is the process of hiding the implementation details of a class and showing only the necessary features to the outside world called in C++?
A. Abstraction
B. Polymorphism
C. Encapsulation
D. Inheritance
Answer: Option A
Solution (By Examveda Team)
Abstraction in C++ refers to the process of hiding the implementation details of a class and exposing only the essential features to the outside world.It allows the user to interact with an object without knowing the internal complexity, making the code cleaner, modular, and easier to maintain.
Why other options are incorrect:
Polymorphism deals with using the same function or operator in different ways.
Encapsulation is about wrapping data and functions together into a single unit (class).
Inheritance allows one class to acquire the properties of another.
Therefore, the correct answer is Abstraction.
Join The Discussion
Comments (1)
A. A function used to create objects
B. A special member function that initializes objects
C. A function used to access class members
D. None of the above
Which access specifier allows constructors to be called from anywhere in the program in C++?
A. friend
B. protected
C. public
D. private
What happens if a class does not explicitly declare any constructors in C++?
A. A compilation error occurs
B. The class cannot be instantiated
C. The class is initialized with default values
D. A default constructor is provided by the compiler
What is the purpose of a destructor in C++?
A. A special member function that destroys objects
B. A function used to create objects
C. A function used to initialize objects
D. A function used to access class members

I thought its answer might be Abstraction.