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 KumarRank #621 · 3.8K reputationPosted Mar 3, 2016, 9:20 PM EST
ali tuncerRank #1,499 · 1.1K reputationPosted Feb 24, 2016, 11:35 PM EST
Shubham KumarRank #621 · 3.8K reputationPosted Feb 24, 2016, 11:36 PM EST
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();
}
}
Ankit KumarRank #6,715 · 258 reputationPosted Feb 25, 2016, 12:52 AM EST
Shubham KumarRank #621 · 3.8K reputationPosted Feb 25, 2016, 1:25 AM EST
ali tuncerRank #1,499 · 1.1K reputationPosted Feb 25, 2016, 1:26 AM EST
this is wrong:
Shubham KumarRank #621 · 3.8K reputationPosted Feb 25, 2016, 1:29 AM EST
Ankit KumarRank #6,715 · 258 reputationPosted Feb 25, 2016, 1:56 AM EST