IndiaBIX
IndiaBIX
Start typing & press "Enter" or "ESC" to close
  • Home
  • Jobs
  • Results
  • Current Affairs
  • GK
  • Online Test
  • HR Interview
  • BLOG

Objects and Classes (3)

  • Home
  • Computer Science & Engineering
  • C++ Programming Questions and Answers
  • Objects and Classes
17. 

Which of the following access specifies is used in a class definition by default?

A. Protected
B. Public
C. Private
D. Friend

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

18. 

Which of the following statements is correct about the constructors and destructors?

A. Destructors can take arguments but constructors cannot.
B. Constructors can take arguments but destructors cannot.
C. Destructors can be overloaded but constructors cannot be overloaded.
D. Constructors and destructors can both return a value.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

19. 

Which of the following statements is correct when a class is inherited publicly?

A. Public members of the base class become protected members of derived class.
B. Public members of the base class become private members of derived class.
C. Private members of the base class become protected members of derived class.
D. Public members of the base class become public members of derived class.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

20. 

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.
View Answer Discuss Workspace Report

21. 

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.
View Answer Discuss Workspace Report

22. 

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.
View Answer Discuss Workspace Report

23. 

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.
View Answer Discuss Workspace Report

24. 

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.
View Answer Discuss Workspace Report

  • 1
  • 2
  • 3

Questions & Answers

Aptitude Chemical Engineering Civil Engineering Computer Science & Engineering Current Affairs Data Interpretation Electrical & Electronics Engineering Electronics & Communication Engineering General Knowledge Logical Reasoning Mechanical Engineering Non Verbal Reasoning Verbal Ability Verbal Reasoning

Interviews

HR Interview

Jobs

Sarkari Jobs

Results

Rojgar ResultSarkari Result

Admission

Admission 2023

Admit Card

Admit Card 2023

Answer Key

Answer Key 2023
copyright
Privacy Policy
© 2025 IndiaBIX. All Rights Reserved.

Report