Actually the code below is Simple example of interface.But it showing an error 'PublicDemo.DemoPublic' does not implement interface member 'PublicDemo.demo1.two()'. 'PublicDemo.DemoPublic.two()' cannot implement an interface member because it is not public.
namespace PublicDemo
{
public interface demo
{
void Demo();
}
public interface demo1:demo
{
void one();
void two();
}
class DemoPublic :demo1
{
protected internal string variable;
public void Demo()
{
Console.WriteLine("{0}", variable);
}
public void one()
{
Console.WriteLine("this is one method");
}
protected void two()
{
Console.WriteLine("this is two method");
}
}
class Excute : DemoPublic
{
static void Main(string[] args)
{
Excute Dp = new Excute();
Dp.variable = Console.ReadLine();
Dp.Demo();
Dp.one();
Dp.two();
Console.ReadKey();
}
}
}
i need why it is not working