Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

related to inheritance in c#

This is a discussion on related to inheritance in c# within the OOPS forums, part of the Software Development category; Do you know the actual types of inheritance in C# ?...

Go Back   Geeks Talk > Software Development > OOPS
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

OOPS Object-Oriented Programming Concepts

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-16-2009
Junior Member
 
Join Date: Jan 2009
Location: Mumbai
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
tej.net is on a distinguished road
related to inheritance in c#

Do you know the actual types of inheritance in C# ?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-20-2009
Junior Member
 
Join Date: Mar 2009
Location: hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
spicysunny is on a distinguished road
Re: related to inheritance in c#

Inheritance:
C# supports two types of inheritance mechanisms
1. Implementation Inheritance
2. Interface Inheritance

What is Implementation Inheritance?
- When a class (type) is derived from another class (type) such that it inherits all the members of the base type it is Implementation Inheritance

What is Interface Inheritance?
- When a type (class or a struct) inherits only the signatures of the functions from another type it is Interface Inheritance.

In general Classes can be derived from another class, hence support Implementation inheritance. At the same time Classes can also be derived from one or more interfaces. Hence they support Interface inheritance. Struts can derive from one more interface, hence support Interface Inheritance. Structs cannot be derived from another class they are always derived from System.ValueType

Multiple Inheritance:
C# does not support multiple implementation inheritance. A class cannot be derived from more than one class. However, a class can be derived from multiple interfaces.
Reply With Quote
  #3 (permalink)  
Old 03-20-2009
Junior Member
 
Join Date: Mar 2009
Location: hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
spicysunny is on a distinguished road
Thumbs up Re: related to inheritance in c#

Inheritance:
c# supports two types of inheritance mechanisms
1. Implementation inheritance
2. Interface inheritance
what is implementation inheritance?
- when a class (type) is derived from another class (type) such that it inherits all the members of the base type it is implementation inheritance
what is interface inheritance?
- when a type (class or a struct) inherits only the signatures of the functions from another type it is interface inheritance. In general classes can be derived from another class, hence support implementation inheritance. At the same time classes can also be derived from one or more interfaces. Hence they support interface inheritance. Struts can derive from one more interface, hence support interface inheritance. Structs cannot be derived from another class they are always derived from system.valuetype
multiple inheritance:
c# does not support multiple implementation inheritance. A class cannot be derived from more than one class. However, a class can be derived from multiple interfaces.
Reply With Quote
Reply

  Geeks Talk > Software Development > OOPS

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Types of Inheritance scott OOPS 26 08-09-2009 02:01 AM
multiple inheritance using amuthsen Java 4 04-07-2009 02:21 AM
Inheritance pradeeban2getplaced C and C++ 2 10-11-2008 03:09 PM
About inheritance rajimurugan Java 3 09-20-2007 10:01 AM
inheritance sumad C# 4 06-06-2007 12:36 AM


All times are GMT -4. The time now is 12:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved