Object can only inherit from one parent?

I had a an online test for a job and they asked this question and I'm not sure whether I blew it. It sounds like it may be a trick question.

I answered yes.

I think the question may have actually been "objects can only inherit from a parent" in which case, what would that answer be?
EindoofusAsked:
Who is Participating?
 
anarki_jimbelCommented:
Hmm... Not too correct question, I'd say. Not objects. Classes. Classes may inherit from one parent only.

"objects can only inherit from a parent"  - there is one parent in inheritance but there are grand parent, grand-grand... etc.
0
 
Frank WhiteCommented:
Perhaps this article might provide some clarification: .NET and Multiple Inheritance - David C. Chou
0
 
anarki_jimbelCommented:
http://msdn.microsoft.com/en-us/library/ms973803.aspx

"In the .NET world, only single inheritance is allowed, so each subclass will have only one base class.

There are three types of inheritance that .NET supports: implementation, interface, and visual. Implementation inheritance refers to the ability to use a base class's properties and methods with no additional coding. Interface inheritance refers to the ability to use just the names of the properties and methods, but the child class must provide the implementation. Visual inheritance refers to the ability for a child form (class) to use the base forms (class) visual representation as well as the implemented code.

A class in .NET may inherit from a class that has already inherited from another class. In addition you may use an interface or even multiple interfaces within a class."

If question was like ""objects can only inherit from a parent" " - the answer would be No as it may inherit from grandparents... Hate these questions and people asking them :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.