Loading...

C++ Multiple Choice Questions

Our C++ questions and answers focuses on all areas of C++ programming language covering 100+ topics in C++

C++ OOPs Concepts MCQ | Set 4

C++ OOPs Concepts | Set 4


31. Which of the following is a static polymorphism mechanism?

a) Function overloading
b) Operator overloading
c) Templates
d) All of the mentioned



32. Which of the following is true?

I) All operators in C++ can be overloaded.
II) The basic meaning of an operator can be changed.
a) I only
b) II only
c) Both I and II
d) Neither I nor II



33. Which of the following is not a type of inheritance?

a) Multiple
b) Multilevel
c) Distributive
d) Hierarchical



34. What happens if a class does not have a name?

a) It will not have a constructor
b) It will not have a destructor
c) It is not allowed
d) It will neither have a constructor or destructor



35. Which of the following statement is true?

I) In Procedural programming languages, all function calls are resolved at compile-time
II) In Object Oriented programming languages, all function calls are resolved at compile-time
a) I only
b) II only
c) Both I and II
d) Neither I nor II



36. Which members are inherited but are not accessible in any case?

a) Private
b) Public
c) Protected
d) Both private and protected



37. Which of the following is correct?

a) Friend functions can access public members of a class
b) Friend functions can access protected members of a class
c) Friend functions can access private members of a class
d) All of the mentioned



38. Which of the following is correct in C++?

a) Classes cannot have protected data members
b) Structures can have member functions
c) Class members are public by default
d) Structure members are private by default



39. Which of the following is used to make an abstract class?

a) By using virtual keyword in front of a class declaration
b) By using an abstract keyword in front of a class declaration
c) By declaring a virtual function in a class
d) By declaring a pure virtual function in a class



40. Which of the following is correct?

a) A class is an instance of its objects
b) An object is an instance of its class
c) A class is an instance of the data type that the class have
d) An object is an instance of the data type of the class



- Related Topics