0

What happens if you inherit multiple interfaces and they have conflicting method names?

using System;
 
namespace WindowsApplication1
{
public interface a
{
void b();
}
public interface c
{
void b();
}
public class Class1:a,c
{
public Class1()
{
//
// TODO: Add constructor logic here
//
}
#region a Members
 
public void d()
{
// TODO: Add Class1.d implementation
}
 
#endregion
 
#region c Members
 
public void b()
{
// TODO: Add Class1.b implementation
}
 
#endregion
}

Edited by Narue: Added code tags

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by gerard4143
0

Then you have to explicitly refer to the members

public void a.b()
{
// TODO: Add Class1.d implementation
}

Edited by gerard4143: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.