Two or more interfaces can be combined into a single interface and implemented in a class
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
interface inter
{
void show();
}
interface inter1
{
void display();
}
interface combineinter : inter, inter1
{
//Above interface combined
}
class multipleinterimp : combineinter
{
public void show()
{
System.Console.WriteLine("show() method implemented");
System.Console.ReadLine();
}
public void display()
{
System.Console.WriteLine("Display() method implemented");
System.Console.Read();
}
static void Main(string[] args)
{
multipleinterimp interp = new multipleinterimp();
interp.show();
interp.display();
}
}
}
}
OUTPUT
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
interface inter
{
void show();
}
interface inter1
{
void display();
}
interface combineinter : inter, inter1
{
//Above interface combined
}
class multipleinterimp : combineinter
{
public void show()
{
System.Console.WriteLine("show() method implemented");
System.Console.ReadLine();
}
public void display()
{
System.Console.WriteLine("Display() method implemented");
System.Console.Read();
}
static void Main(string[] args)
{
multipleinterimp interp = new multipleinterimp();
interp.show();
interp.display();
}
}
}
}
OUTPUT