using System;
public class Test
{
public static void Main()
{
Lol l = new Lol();
Console.WriteLine(((IParent)l).Family);
Console.WriteLine(((IChild)l).Family);
Console.WriteLine(l.Name);
}
}
public interface IParent
{
string Family { get; }
}
public interface IChild : IParent
{
string Name { get; }
}
public class Lol : IChild
{
string IParent.Family { get { return "suck"; } }
string IChild.Family { get { return "duck"; } }
public string Name { get { return "ross"; } }
}
public class Lol : IChild, IParent
using System;
public class Test
{
public static void Main()
{
Lol l = new Lol();
Console.WriteLine(((IParent)l).Family);
Console.WriteLine(((IChild)l).Family);
Console.WriteLine(l.Name);
Console.ReadLine ();
}
}
public class IParent
{
public string Family { get { return "suck"; } }
}
public class IChild : IParent
{
public string Family { get { return "duck"; } }
}
public class Lol : IChild
{
public string Name { get { return "ross"; } }
}
// Вывод:
// suck
// duck
// ross
public class Lol : IChild, IParent // !!!
{
string IParent.Family { get { return "suck"; } }
string IChild.Family { get { return "duck"; } }
public string Name { get { return "ross"; } }
}
public interface IChild : IParent
{
new string Family { get; }
string Name { get; }
}