True Or False

Question 1 :

Multiple inheritance is different from multiple levels of inheritance.


A). True
B). False
Answer : Option A

Explanation :

Multiple inheritance means deriving a class from more than one classes. On the other hand, multiple levels of inheritance means a class has been derived from a base class and the base class itself has been derived from another base class. Multiple inheritance is not permitted in C#.NET.


Question 2 :

An object of a derived class cannot access private members of base class.


A). True
B). False
Answer : Option A

Explanation :

The private members of the base class are never accessible outside the class.


Question 3 :

The way a derived class member function can access base class public members, the base class member functions can access public member functions of derived class.


A). True
B). False
Answer : Option B

Explanation :

Base class cannot access derived class members since it does not have any knowledge of the derived class.


Question 4 :

There is no private or protected inheritance in C#.NET.


A). True
B). False
Answer : Option A

Question 5 :

We can derive a class from a base class even if the base class's source code is not available.


A). True
B). False
Answer : Option A

Explanation :

We can derive from a base class even if it is present in an assembly.


Question 6 :

If a base class contains a member function func(), and a derived class does not contain a function with this name, an object of the derived class cannot access func().


A). True
B). False
Answer : Option B

Explanation :

It depends upon how the function func() has been defined in the base class. If the function func() is defined public in base class then an object of the derived class can access the function func().


Question 7 :

If a base class and a derived class each include a member function with the same name, the member function of the derived class will be called by an object of the derived class


A). True
B). False
Answer : Option A

Explanation :

This is because the member functions are always searched in the derived class and then in the base class.


Question 8 :

The size of a derived class object is equal to the sum of sizes of data members in base class and the derived class.


A). True
B). False
Answer : Option A

Question 9 :

Private members of base class cannot be accessed by derived class member functions or objects of derived class.


A). True
B). False
Answer : Option A

Question 10 :

A class D can be derived from a class C, which is derived from a class B, which is derived from a class A.


A). True
B). False
Answer : Option A

Explanation :

This is known as multiple levels of inheritance.


Question 11 :

There is no multiple inheritance in C#.NET. That is, a class cannot be derived from multiple base classes.


A). True
B). False
Answer : Option A

Question 12 :

Creating a derived class from a base class requires fundamental changes to the base class.


A). True
B). False
Answer : Option B

Question 13 :

It is illegal to make objects of one class as members of another class.


A). True
B). False
Answer : Option A