Re: Multiple interface implementation
- From: "JTC^..^" <dave@xxxxxxxxxxxxxxxx>
- Date: Mon, 23 Nov 2009 11:17:02 -0800 (PST)
On 23 Nov, 04:27, Raj <R...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
While implementing multiple interfaces having same method name, in the
derived class without explicit implementation, if only one method is
implemented like the below way, whether the .NET CLR will refer to interface
one or two? Since this leads to ambiguity, why is the .NET CLR not throwing
any warning or error??
Code snippet for observation:
interface int1
{
void test()
}
interface int2
{
void test()
}
class Program:int1,int2
{
public void test()
{
Console.WriteLine("test");
}
pubic static void Main()
{
Program p=new Program();
p.test();
Console.Read();
}
}
Thank you
Regards
Raj
It's all a question of how you would like to "interface" with your
class. I agree that your question doesn't make much sense. Are you
doing an exercise to understand interfaces or do you have a real world
example?
.
- References:
- Multiple interface implementation
- From: Raj
- Multiple interface implementation
- Prev by Date: Re: Proportional resizing of an image
- Next by Date: General SOA question
- Previous by thread: Re: Multiple interface implementation
- Next by thread: Re: Multiple interface implementation
- Index(es):
Relevant Pages
|