Presentation on theme: "ITF11006.NET Inheritance. Classes and Inheritance Constructors and Inheritance Modifiers Interfaces Operators."— Presentation transcript:
Classes and Inheritance Constructors and Inheritance Modifiers Interfaces Operators
Class Single Implementation Inheritance Multiple Interface Inheritance Method Overloading – Polymorphism Method Overriding – Polymorphism Calling methods (base) Abstract Classes and Functions Sealed Classes and Methods
Constructors and Inheritance Constructors – Default constructor – May be overloaded – Access Modifiers – Static – Constructor hierarchy (base / this)
Access Modifiers ModifierMeaning publicAccess is not restricted. protectedAccess is limited to the containing class or types derived from the containing class. internalAccess is limited to the current assembly. protected internalAccess is limited to the current assembly or types derived from the containing class. privateAccess is limited to the containing type.
Other Modifiers ModifierMeaning newThe member hides an inherited member with the same signature. staticThe member is a class level member. virtualThe member can be overridden by a derived class. abstractA virtual member that defines the signature of the member, but doesn’t provide an implementation. overrideThe member overrides an inherited virtual or abstract member. sealedFor classes, the class cannot be inherited. For members, the member cannot be overridden in any derived classes. externThe member is implemented externally.