Explore topic-wise MCQs in Constructors and Destructors .

This section includes 4 Mcqs, each offering curated multiple-choice questions to sharpen your Constructors and Destructors knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following statements are correct for a static member function?

A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.
Answer» D. Both 1 and 2 are incorrect.
2.

Which of the following statements is correct about the program given below?

A. The program reports an error as pointer to member function cannot be defined outside the definition of class.
B. The program reports an error as pointer to static member function cannot be defined.
C. The program reports an error as pointer to member function cannot be defined without object.
D. The program reports linker error.
Answer» E.
3.

What does the class definitions in following code represent?

A. kind of relationship
B. has a relationship
C. Inheritance
D. Both A and B
Answer» C. Inheritance
4.

What happens when we try to compile the class definition in following code snippet?

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» E.