Skip to main content

Posts

Showing posts from October 5, 2014

Features of Interface

Features of Interface     An interface doesn't provide inheritance like a class or abstract class but it only declare members which an implementing class need to be implement.     It cannot be instantiated but it can be referenced by the class object which implements it. Also, Interface reference works just like object reference and behave like as object.         IStore IObjStore = new Document();         ICompress IObjCompress = new Document();     It contains only properties, indexers, methods, delegates and events signature.     It cannot contains constants members, constructors, instance variables, destructors, static members or nested interfaces.     Members of an interface cannot have any access modifiers even public.     Implicitly, every member of an interface is public and abstract. Also, you are not allowed to speci...

Features Of Abstract Class

Features of Abstract Class     An abstract class cannot be instantiated.     An abstract class contain abstract members as well as non-abstract members.     An abstract class cannot be a sealed class because the sealed modifier prevents a class from being inherited and the abstract modifier requires a class to be inherited.     A non-abstract class which is derived from an abstract class must include actual implementations of all the abstract members of parent abstract class.     An abstract class can be inherited from a class and one or more interfaces.     An Abstract class can has access modifiers like private, protected, internal with class members. But abstract members cannot have private access modifier.     An Abstract class can has instance variables (like constants and fields).     An abstract class can has constructors and destructor.     A...