GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Microsoft  >  C#
Go To First  |  Previous Question  |  Next Question 
 C#  |  Question 375 of 432    Print  
Why inheritance is not supported by structures??

  
Total Answers and Comments: 4 Last Update: November 11, 2008     Asked by: divya_insearch 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 22, 2007 14:11:38   #1  
       

RE: Why inheritance is not supported by structures??
What used to be a struct in original C language moved on to C++ and then C#. Although lot of class capabilities have been added into struct, its purpose is to just group together few fields and may optionally contain some methods for their manipulation. The inheritance is a powerful object oriented concept implemented through classes. Structures (struct) are not appropriate for replacement of classes, while classes could easily be used in place of structure. In fact, you can do virtually do any thing with classes -- structs are still around primarily for historic reasons.
 
Is this answer useful? Yes | No
December 14, 2007 08:05:25   #2  
pankajgharge Member Since: December 2007   Contribution: 1    

RE: Why inheritance is not supported by structures??
Because structures are value types.
 
Is this answer useful? Yes | No
April 04, 2008 08:48:10   #3  
Vikas Yadav Member Since: April 2008   Contribution: 15    

RE: Why inheritance is not supported by structures??
Structure support only interface inheritance but it don't  implementation(class) inheritance. Most probably bcoz its language(C#) feature and avoided due to complexities arised implementing it.
 
Is this answer useful? Yes | No
November 11, 2008 09:41:46   #4  
seemu123 Member Since: May 2008   Contribution: 15    

RE: Why inheritance is not supported by structures??
The Main facts for Inheritence to any thing that is it should worked as Base. And Structure could not worked as Base due to it is Value type. So, Inheritence is not supported by Structure.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape