Showing posts with label Interface. Show all posts
Showing posts with label Interface. Show all posts

Wednesday, 9 May 2012

Can We inherit the interface into another interface?


For Asp.net Training with C# Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com

Can We inherit the interface into another interface?



Yes we can inherit the interface into another interface. It follows the same signature for inheritance as we use to inherit the class like:-

1.     Create first interface

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

Basic of Interface


For Asp.net Training with C# Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com

Basic of Interface
Interface is an entity which gives signature or a structure which class have to implement. It contains only declaration not definition. The class which implement the interface will give the definition to each member. It means we can only declare the method, property and event.
Simply interface is ‘what’ should be done and its implementation is ‘how’ it should be done.
Note:-1. All members of the Interface declared without access specifier like public, private etc.
2. We cannot declare any variable in interface.
3. All members should be implemented in the derived class.