Wednesday 3 June 2020

UGC NET Computer Science December 2019 | Question 121

Question 121
Which of the following statements are true regarding C++?
(a) Overloading gives the capability to an existing operator to operate on other data types.
(b) Inheritance in object oriented programming provides support to reusability.
(c) When object of a derived class is defined, first the constructor of derived class is executed then constructor of a base class is executed.
(d) Overloading is a type of polymorphism.
Choose the correct option from those given below :
  1. 1. (a) and (b) only
  2. 2. (a). (b) and (c) only
  3. 3. (a). (b) and (d) only
  4. 4. (b). (c) and (d) only
Answer :

Explanation Question 121

  • Overloading gives the capacity to an existing operator to operate on other data types. True
  • Inheritance in object oriented programming provides support to reusability. True
  • When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed. True
  • Overloading is a type of polymorphism. True

2 important points Order of Constructor Call with Inheritance in C++
  1. Whether derived class's default constructor is called or parameterised is called, base class's default constructor is always called inside them.
  2. To call base class's parameterised constructor inside derived class's parameterised constructor, we must mention it explicitly while declaring derived class's parameterized constructor.
So, option 3 is correct answer


PreviousNext
UGC NET CS December 2019 - Question 120UGC NET CS December 2019 - Question 122

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts