Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Object can only inherit from one parent?

Posted on 2012-03-14
3
Medium Priority
?
338 Views
Last Modified: 2012-03-15
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?
0
Comment
Question by:Eindoofus
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Frank White
ID: 37723259
Perhaps this article might provide some clarification: .NET and Multiple Inheritance - David C. Chou
0
 
LVL 30

Accepted Solution

by:
anarki_jimbel earned 2000 total points
ID: 37723268
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
 
LVL 30

Assisted Solution

by:anarki_jimbel
anarki_jimbel earned 2000 total points
ID: 37723273
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question