Inheritance c programming questions

1.

Multiple inheritance is different from multiple levels of inheritance.
A.     True    B.     False
Answer & Explanation

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.
View Answer Workspace Report Discuss in Forum
2.

An object of a derived class cannot access private members of base class.
A.     True    B.     False
Answer & Explanation

Answer: Option A

Explanation:

The private members of the base class are never accessible outside the class.
View Answer Workspace Report Discuss in Forum
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 & Explanation

Answer: Option B

Explanation:

Base class cannot access derived class members since it does not have any knowledge of the derived class.
View Answer Workspace Report Discuss in Forum
4.

There is no private or protected inheritance in C#.NET.
A.     True    B.     False
Answer & Explanation

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
View Answer Workspace Report Discuss in Forum
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 & Explanation

Answer: Option A

Explanation:

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

Leave a Reply0

Your email address will not be published.