Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2008

Tip: Looking for answers? Try searching our database.

Help with the difference between "Implements" and "Inherits"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom P. - 24 Jul 2008 19:50 GMT
What would the difference be between the following two:

public class Foo : IList<string>
{
...
}

public class Foo : List<string>
{
...
}

Thanks,
Tom P.
Adam Clauss - 24 Jul 2008 19:53 GMT
In the first one, Foo would have to manually implement all the members
defined by IList<string>.

In the second one, Foo would already come complete with all the
implementation that exists in List<string>, and you could just add
additional functionality on top of it.

Signature

Adam Clauss

> What would the difference be between the following two:
>
[quoted text clipped - 10 lines]
> Thanks,
> Tom P.
Arne Vajhøj - 24 Jul 2008 21:53 GMT
> What would the difference be between the following two:
>
[quoted text clipped - 7 lines]
> ...
> }

The first only inherit the interface. The second inherit
only the interface and the implementation.

But I would be careful with the second - it is easy to
become coupled with the internals of List.

Arne

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.