By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,193 Members | 1,789 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,193 IT Pros & Developers. It's quick & easy.

question about extending and combining interfaces

P: n/a
I'm looking at the O'Reilly Programming C# book and I have a question about
extending and combining interfaces syntax. It just looks a bit odd to me,
the two syntaxes look identical, but how does C# know which is extending and
which is combining?

interface IStorable{
void Read();
void Write(object o);
}

interface ICompressible{
void LogSavedBytes();
}

interface IStorableCompressible : IStoreable, ICompressible{
void LogOriginalSize();
}

This appears on the surface to be extending multiple interfaces? I thought
you couldn' do that in C#? Maybe I'm just confused, sorry. Help.
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Flip <[remove]ph******@hotmail.com> wrote:
I'm looking at the O'Reilly Programming C# book and I have a question about
extending and combining interfaces syntax. It just looks a bit odd to me,
the two syntaxes look identical, but how does C# know which is extending and
which is combining?

interface IStorable{
void Read();
void Write(object o);
}

interface ICompressible{
void LogSavedBytes();
}

interface IStorableCompressible : IStoreable, ICompressible{
void LogOriginalSize();
}

This appears on the surface to be extending multiple interfaces? I thought
you couldn' do that in C#? Maybe I'm just confused, sorry. Help.


C# allows multiple inheritence of interface, just not implementation.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

P: n/a
"Flip" <[remove]ph******@hotmail.com> wrote:
interface IStorableCompressible :
IStoreable, ICompressible{
void LogOriginalSize();
}
This appears on the surface to be extending
multiple interfaces? I thought you couldn' do
that in C#?


C# permits multiple inheritance from interfaces, but not from classes.

P.
Nov 16 '05 #3

P: n/a
Thanks for the heads up Jon and Paul. I'll be reading more into this on the
weekend! :>
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.