C++ Programming - Objects and Classes

Why should I learn to solve C++ Programming questions and answers section on "Objects and Classes"?

Learn and practise solving C++ Programming questions and answers section on "Objects and Classes" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.

Where can I get the C++ Programming questions and answers section on "Objects and Classes"?

IndiaBIX provides you with numerous C++ Programming questions and answers based on "Objects and Classes" along with fully solved examples and detailed explanations that will be easy to understand.

Where can I get the C++ Programming section on "Objects and Classes" MCQ-type interview questions and answers (objective type, multiple choice)?

Here you can find multiple-choice C++ Programming questions and answers based on "Objects and Classes" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.

How do I download the C++ Programming questions and answers section on "Objects and Classes" in PDF format?

You can download the C++ Programming quiz questions and answers section on "Objects and Classes" as PDF files or eBooks.

How do I solve C++ Programming quiz problems based on "Objects and Classes"?

You can easily solve C++ Programming quiz problems based on "Objects and Classes" by practising the given exercises, including shortcuts and tricks.

Exercise : Objects and Classes - General Questions
1.
What happens when we try to compile the class definition in following code snippet?
class Birds {};
class Peacock : protected Birds {};
It will not compile because class body of Birds is not defined.
It will not compile because class body of Peacock is not defined.
It will not compile because a class cannot be protectedly inherited from other class.
It will compile succesfully.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

2.
Which of the following statements is incorrect?
Friend keyword can be used in the class to allow access to another class.
Friend keyword can be used for a function in the public section of a class.
Friend keyword can be used for a function in the private section of a class.
Friend keyword can be used on main().
Answer: Option
Explanation:
No answer description is available. Let's discuss.

3.
Which of the following statement is correct regarding destructor of base class?
Destructor of base class should always be static.
Destructor of base class should always be virtual.
Destructor of base class should not be virtual.
Destructor of base class should always be private.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

4.
Which of the following two entities (reading from Left to Right) can be connected by the dot operator?
A class member and a class object.
A class object and a class.
A class and a member of that class.
A class object and a member of that class.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

5.
How can we make a class abstract?
By making all member functions constant.
By making at least one member function as pure virtual function.
By declaring it abstract using the static keyword.
By declaring it abstract using the virtual keyword.
Answer: Option
Explanation:
No answer description is available. Let's discuss.