Thursday 30 August 2012

Interface In C# with Code | interface implementation

Program how to write c sharp interface program ;
namespace interfaces
{
interface Icalculation
{
void add(int a, int b);
void sub(int a, int b);
}

class calculator:Icalculation
{
int res1;
int res2;

public void add(int a, int b)
{
Console.WriteLine("Addition is:" + (a + b));
}

public void sub(int a, int b)
{
Console.WriteLine("Subtraction is:" + (a - b));
}

static void Main(string[] args)
{
calculator cl = new calculator();
cl.add(100, 100);
Console.WriteLine();
cl.sub(200, 100);
Console.WriteLine();
Console.ReadLine();
}
}
}
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: