using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicationinterface
{
public interface IsampleInterface
{
void sampleMethod();
}
class program : IsampleInterface
{
void IsampleInterface.sampleMethod()
{
Console.WriteLine("example of interface");
}
public static void Main(string[] args)
{
IsampleInterface rect = new program();
rect.sampleMethod();
Console.ReadKey();
}
}
}
Output:

using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicationinterface
{
public interface IsampleInterface
{
void sampleMethod();
}
class program : IsampleInterface
{
void IsampleInterface.sampleMethod()
{
Console.WriteLine("example of interface");
}
public static void Main(string[] args)
{
IsampleInterface rect = new program();
rect.sampleMethod();
Console.ReadKey();
}
}
}
Output:
No comments:
Post a Comment