On This Page

This set of Object Oriented Programming OOP Multiple Choice Questions & Answers (MCQs) focuses on Object Oriented Programming Set 4

Q1 | C++ was originally developed by ….......
Q2 | Which of the following approach is adopted in C++?
Q3 | Which feature of C++ contain the concept of super class and subclass?
Q4 | The main intention of using inheritance is ….........
Q5 | If particular software can be used in some other application than the one for which it is created then it reveals ….........
Q6 | Which of the following data type does not return anything?
Q7 | How many objects can be created from an abstract class?
Q8 | Which of the following statements is correct for a static member function?1. It can access only other static members of its class. It can be called using the class name, instead of objects
Q9 | What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
Q10 | Which of the following interface determines how your program will be used by other program?
Q11 | What is the difference between struct and class in C++?
Q12 | Predict the output of following C++ program#include using namespace std;class Empty {}; int main(){cout <
Q13 | class Test { int x;};int main(){Test t; cout <
Q14 | Which of the following is true?
Q15 | Which of the following is true about the following program#include class Test{public:int i;void get();};void Test::get(){std::cout <<"Enter the value of i: "; std::cin >>i;}Test t; // Global object int main(){Test t; // local object t.get();std::cout <<"value of i in local t: "<
Q16 | Which of the following is true about new when compared with malloc. 1) new is an operator, malloc is a function 2) new calls constructor, malloc doesn't 3) new returns appropriate pointer, malloc returns void * and pointer needs to typecast to appropriate type.
Q17 | Predict the output?#include using namespace std;class Test{int x;Test() { x = 5;}};int main(){Test *t = new Test; cout <x;}
Q18 | What happens when delete is used for a NULL pointer? int *ptr = NULL;delete ptr;
Q19 | Is it fine to call delete twice for a pointer?#include using namespace std;int main(){int *ptr = new int; delete ptr;delete ptr; return 0;}
Q20 | Which of the followings is/are automatically added to every class, if we do not write our own.
Q21 | When a copy constructor may be called?
Q22 | Output of following program?#include using namespace std; class Point {Point() { cout <<"Constructor called"; }};int main(){Point t1; return 0;}
Q23 | #include using namespace std; class Point {public:Point() { cout <<"Constructor called"; }};int main(){Point t1, *t2; return 0;}
Q24 | #include using namespace std;class X{public:int x;};int main(){X a = {10};X b = a;cout <