Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C++ code? #include<iostream> using namespace std; class Base { public: Base() { cout<<"Constructing Base \n"; } ~Base() { cout<<"Destructing Base \n"; } }; class Derived: public Base { public: Derived() { cout<<"Constructing Derived \n"; } ~Derived() { cout<<"Destructing Derived \n"; } }; int main(void) { Derived *d = new Derived(); Base *b = d; delete b; return 0; }
Q2
How access specifiers in Class helps in Abstraction?
Q3
Why references are different from pointers?
Q4
Which of the following explains the overloading of functions?
Q5
Which of the following feature of OOPs is not used in the following C++ code? class A { int i; public: void print(){cout<<"hello"<<i;} } class B: public A { int j; public: void assign(int a){j = a;} }
Q6
Wrapping data and its related functionality into a single entity is known as . . . . . . . .
Q7
What is the other name used for functions inside a class?
Q8
Which of the following is not a type of Constructor?
Q9
Which of the following explains Polymorphism?
Q10
C++ is . . . . . . . .
Q11
What is the difference between delete and delete[] in C++?
Q12
What does polymorphism in OOPs mean?
Q13
Which of the following is correct?
Q14
How compile-time polymorphisms are implemented in C++?
Q15
Out of the following, which is not a member of the class?
Q16
Which of the following cannot be a friend?
Q17
What will be the output of the following C++ code? #include <iostream> using namespace std; class A { int a; A() { a = 5;} }; int main() { A *obj = new A; cout << obj->a; }
Q18
Which of the following approach is used by C++?
Q19
What will be the output of the following C++ code? #include <iostream> using namespace std; class A{ public: A(){ cout<<"Constructor called\n"; } ~A(){ cout<<"Destructor called\n"; } }; int main(int argc, char const *argv[]) { A *a = new A[5]; delete[] a; return 0; }
Q20
What will be the output of the following C++ code? #include <iostream> using namespace std; class A{ public: A(){ cout<<"Constructor called\n"; } ~A(){ cout<<"Destructor called\n"; } }; int main(int argc, char const *argv[]) { A *a = new A[5]; delete a; return 0; }
Q21
Which of the following is an abstract data type?
Q22
What is the correct syntax of declaring array of pointers of integers of size 10 in C++?
Q23
Which concept means the addition of new components to a program as it runs?
Q24
Which of the following provides a programmer with the facility of using object of a class inside other classes?
Q25
What happens if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr;