Today, I want to explain how to use two interface in single method as
Interface
Interface is nothing but contract that define signature of functionality. if a class implement interface
then it says to outer world that it provide specific behavior.
ex:
If a class implement 'IDisposable' interface that means it has functionality to release unused object (Unmanaged resource).
Declare Interface
- interface A1
- {
- void write();
- }
- interface A2
- {
- void write();
- }
- class Program
- {
- interface A1
- {
- void write();
- }
- interface A2
- {
- void write();
- }
- public class A:A1,A2
- {
- public void write()
- {
- Console.WriteLine("Hello Interface");
- }
- }
- static void Main(string[] args)
- {
- A ab = new A();
- Console.WriteLine();
- ab.write();
- Console.ReadLine();
- }
- }



Vishvajeet PawarPosted Nov 6, 2014, 5:54 AM
Jaganathan Bantheswaran Sir..So Simple use Multiple Interface in one method..
Jaganathan BantheswaranPosted Nov 6, 2014, 4:17 AM
Nice one. but the title is confusing me.