Digital-Logic-Design
October 11, 2023ISO-OSI-layers
October 11, 2023OOPS
Question 22 |
Which of the following statements are true regarding C++?
(a) Overloading gives the capacity 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 in executed then constructor of a base class is executed.
(d) Overloading is a type of polymorphism.
Choose the correct option from those given below:
(a) and (b) only | |
(a), (b) and (c) only | |
(a), (b) and (d) only | |
(b), (c) and (d) only |
Question 22 Explanation:
TRUE: Overloading gives the capacity to an existing operator to operate on other data types.
TRUE: Inheritance in object oriented programming provides support to reusability.
FALSE: When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed.
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.
TRUE: Overloading is a type of polymorphism.
TRUE: Inheritance in object oriented programming provides support to reusability.
FALSE: When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed.
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.
TRUE: Overloading is a type of polymorphism.
Correct Answer: C
Question 22 Explanation:
TRUE: Overloading gives the capacity to an existing operator to operate on other data types.
TRUE: Inheritance in object oriented programming provides support to reusability.
FALSE: When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed.
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.
TRUE: Overloading is a type of polymorphism.
TRUE: Inheritance in object oriented programming provides support to reusability.
FALSE: When object of a derived class is defined, first the constructor of derived class in executed then constructor of a base class is executed.
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.
TRUE: Overloading is a type of polymorphism.
Subscribe
Login
0 Comments