C++ Programming - OOPS Concepts

Exercise :: OOPS Concepts - General Questions

  • OOPS Concepts - General Questions
31. 

Which of the following is the correct way of declaring a function as constant?

A. const int ShowData(void) { /* statements */ }
B. int const ShowData(void) { /* statements */ }
C. int ShowData(void) const { /* statements */ }
D. Both A and B

Answer: Option C

Explanation:

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

32. 

Which of the following concepts is used to implement late binding?

A. Virtual function
B. Operator function
C. Const function
D. Static function

Answer: Option A

Explanation:

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

33. 

Which of the following statement is correct?

A. C++ allows static type checking.
B. C++ allows dynamic type checking.
C. C++ allows static member function be of type const.
D. Both A and B.

Answer: Option D

Explanation:

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

34. 

Which of the following factors supports the statement that reusability is a desirable feature of a language?

A. It decreases the testing time.
B. It lowers the maintenance cost.
C. It reduces the compilation time.
D. Both A and B.

Answer: Option D

Explanation:

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

35. 

Which of the following ways are legal to access a class data member using this pointer?

A. this->x
B. this.x
C. *this.x
D. *this-x

Answer: Option A

Explanation:

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