ExamVeda
Login
Home
1
What is a constructor in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
2
Which access specifier allows constructors to be called from anywhere in the program in C++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
3
What happens if a class does not explicitly declare any constructors in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
4
What is the purpose of a destructor in C++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
5
What is the purpose of the 'explicit' keyword before a constructor in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
6
Which keyword is used to prevent inheritance in C++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
7
What is the difference between a shallow copy and a deep copy in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
8
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++?
Discuss
Answer & Solution
Answer: Option A
Solution:
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.
9
What is a constructor initialization list in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
10
What is the access specifier that allows members of a class to be accessed from anywhere in the program in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board