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

  • Thread starter Thread starter Tom P.
  • Start date Start date
T

Tom P.

What would the difference be between the following two:

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



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

Thanks,
Tom P.
 
Tom said:
What would the difference be between the following two:

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

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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top