C++ Programming - Objects and Classes

Why C++ Programming Objects and Classes?

In this section you can learn and practice C++ Programming Questions based on "Objects and Classes" and improve your skills in order to face the interview, competitive examination and various entrance test (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

Where can I get C++ Programming Objects and Classes questions and answers with explanation?

IndiaBIX provides you lots of fully solved C++ Programming (Objects and Classes) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download C++ Programming Objects and Classes quiz questions with answers as PDF files and eBooks.

Where can I get C++ Programming Objects and Classes Interview Questions and Answers (objective type, multiple choice)?

Here you can find objective type C++ Programming Objects and Classes questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.

How to solve C++ Programming Objects and Classes problems?

You can easily solve all kind of C++ Programming questions based on Objects and Classes by practicing the objective type exercises given below, also get shortcut methods to solve C++ Programming Objects and Classes problems.

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 {};

A. It will not compile because class body of Birds is not defined.
B. It will not compile because class body of Peacock is not defined.
C. It will not compile because a class cannot be protectedly inherited from other class.
D. It will compile succesfully.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

2. 

Which of the following statements is incorrect?

A. Friend keyword can be used in the class to allow access to another class.
B. Friend keyword can be used for a function in the public section of a class.
C. Friend keyword can be used for a function in the private section of a class.
D. Friend keyword can be used on main().

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

3. 

Which of the following statement is correct regarding destructor of base class?

A. Destructor of base class should always be static.
B. Destructor of base class should always be virtual.
C. Destructor of base class should not be virtual.
D. Destructor of base class should always be private.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

4. 

Which of the following two entities (reading from Left to Right) can be connected by the dot operator?

A. A class member and a class object.
B. A class object and a class.
C. A class and a member of that class.
D. A class object and a member of that class.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.

5. 

How can we make a class abstract?

A. By making all member functions constant.
B. By making at least one member function as pure virtual function.
C. By declaring it abstract using the static keyword.
D. By declaring it abstract using the virtual keyword.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.