Dear all,
i have a confusion with interface.
i have created a method in interface and trying to give implementation in the derived class.
i am trying to declare the method with access specifiers but with access specifiers, i am getting an error.
Please help me.
below is my code.
using System;
public interface Windows
{
private void Configuration();
}
class Windows_7:Windows
{
public void Configuration()
{
Console.WriteLine("this O.S. is protected by microsoft security team");
Console.WriteLine("This is 32 bit O.S.");
}
}
class Program
{
public static void Main(string[]args)
{Windows_7 obj = new Windows_7();
obj.Configuration();
obj.Test();
Console.ReadLine();
}
}

Shubham KumarPosted Mar 4, 2016, 2:20 AM
Ankit KumarPosted Feb 25, 2016, 6:56 AM
Shubham KumarPosted Feb 25, 2016, 6:29 AM
ali tuncerPosted Feb 25, 2016, 6:26 AM
this is wrong:
Shubham KumarPosted Feb 25, 2016, 6:25 AM
Ankit KumarPosted Feb 25, 2016, 5:52 AM
Shubham KumarPosted Feb 25, 2016, 4:36 AM
public interface IWindows
{
void Configuration();
}
class Windows_7:IWindows
{
public void Configuration()
{
Console.WriteLine("this O.S. is protected by microsoft security team");
Console.WriteLine("This is 32 bit O.S.");
}
}
public class Program
{
public static void Main(string[]args)
{
Windows_7 obj = new Windows_7();
obj.Configuration();
Console.ReadLine();
}
}
ali tuncerPosted Feb 25, 2016, 4:35 AM