Solved

Object can only inherit from one parent?

Posted on 2012-03-14
3
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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