using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
A objA = new A();
B objB = new B();
sendmsg(objA);
sendmsg(objB);
Console.ReadLine();
}
public static void sendmsg(imsg objmsg)
{
objmsg.displaymessage();
}
}
interface imsg
{
void displaymessage();
}
class A : imsg
{
public void displaymessage()
{
Console.WriteLine("this is class A displaymsg()");
}
}
class B : imsg
{
public void displaymessage()
{
Console.WriteLine("this is class B displaymsg()");
}
}
}
Labels: OOPS
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment