Live Help (Start Chat)
View Count: 0
Duration: 22 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 19 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 5 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 24 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 29 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 18
Whenever a base class is inherited in private mode the public data member of the base class cannot be accessible by the member function of the derived class 
Options:
  1. True
  2. False
View Answer/Explanation:
b
Explanation:
Whenever a base class is inherited in private mode the public data member of the base class becomes the private data members of the derived class and hence they are accessible by the member function of the derived class but they are not accessible by the object of the derived class.

Question No: 2 of 18
When Inheritance is protected which of the following is true: 
Options:
  1. Private members of base class are not accessible to derived class
  2. Public members of base class are accessible
  3. Protected members of the base class remain protected in derived class
  4. Public members of the base class become protected in derived class
  5. Private members of the base class are accessible to derived class
View Answer/Explanation:
a c d
Explanation:

Question No: 3 of 18
What is the output of the following program?
#include 
using namespace std;
class A
{
public:
void print()
{
cout <<" This is class A";
}
};
class B : public A
{
public:
void print()
{
cout <<" This is class B";
}
};
class C: public B { };
int main(void)
{
C c;
c.print();
return 0;
} 
Options:
  1. This is class A
  2. This is class B
  3. Compiler Error: Ambiguous call to print()
  4. Runtime Error
View Answer/Explanation:
b
Explanation:
Class c does not have any method with the name print but also it is able to access it because it is inheriting the base class and it can inherits the methods or data members of the inherited base class.

Question No: 4 of 18
Whenever a base class having protected data member is inherited in private mode, the protected data member of the base class becomes ………………… data member of the derived class. 
Options:
  1. Public
  2. Private
  3. Protected
  4. Inherited
View Answer/Explanation:
b
Explanation:

Question No: 5 of 18
Whenever a base class having protected data member is inherited in public mode, the protected data member of the base class becomes ………………… data member of the derived class. 
Options:
  1. Public
  2. Private
  3. Protected
  4. Inherited
View Answer/Explanation:
c
Explanation:

Question No: 6 of 18
Inheritance can be simple or complex based on: 
Options:
  1. Reusability
  2. No. of Derived class
  3. Encapsulation
  4. No. of base classes
View Answer/Explanation:
d
Explanation:

Question No: 7 of 18
Which of these following is used for multiple inheritance 
Options:
  1. Dot
  2. Comma
  3. Dollar
  4. Tilde
View Answer/Explanation:
b
Explanation:
When using multiple inheritance, we specify each base class separated by a comma.

Question No: 8 of 18
Whenever the derived class has more than 1 base class and the derived class for 1 class acts as the base class for other that type of inheritance is known as 
Options:
  1. Multipath inheritance
  2. Hierarchical inheritance
  3. Multiple inheritance
  4. Multilevel inheritance
View Answer/Explanation:
d
Explanation:

Question No: 9 of 18
What are the two types of inheritances that used in hybrid inheritance 
Options:
  1. Multilevel inheritance, multiple inheritance
  2. Hierarchical inheritance, multilevel inheritance
  3. Multiple inheritance, hybrid inheritance
  4. Multipath inheritance, multilevel inheritance
View Answer/Explanation:
a
Explanation:
In hybrid inheritance we have both multilevel inheritance and multiple inheritance.

Question No: 10 of 18
How the duplication of inherited data members can be avoided? 
Options:
  1. By using virtual base class
  2. Using derived class
  3. By making the common base class as the virtual base class
  4. None of the above
View Answer/Explanation:
c
Explanation:
by making the common base class as the virtual base class

  1