SlideShare a Scribd company logo
1 of 11
Inheritance

Types  of inheritance
Implementing inheritance
Interface
TYPES OF INHERITANCE
   Implementation inheritance means that a
    type derives from a base type, taking all the
    base type’s member fields and functions.

   Interface inheritance means that a type
    inherits only the signatures of the functions
    and does not inherit any implementations.
IMPLEMENTATION
INHERITANCE
  A class derive from another class
 syntax:
Class MyDerivedClass: MyBaseClass
{ //function and data memebers here}

  A class derive from interface,the list of base class
   and interfaces is separated by commas
syntax:
Public class MyDerivedClass: MyBaseClass,
   Interface1,Interface2
{//function and data memebers here}
VIRTUAL METHODS
 By declaring a base class function as virtual, you allow the function to
  be overridden in any derived classes.
  Class MyBaseClass
   {
    public virtual string VirtualMethod( )
         { return “this method is virtural and defined in MyBaseClass” ;}
   }
 It is also permitted to declare a property as virtual.
  Public virtual string ForeName
  {
     get { return foreName;}
     set { foreName=value;}
  }
HIDING METHODS
   If a method with the same signature is declared in both base and derived
    classes, but the methods are not declared as virtual and override,
    respectively, then the derived class version is said to hide the base class
    version.

 Abstract          classes and Functions:
   An abstract class cannot be instantiated,were as an abstract function does
    not have an implementation,and must be overriden in any non-abstract
    derived class
   Abstract function is automatically virtual.
SEALED CLASSES AND
METHODS
   C# allows classes and methods to be declared as sealed.
 In case of class this means that you can’t inherit from that class
  syntax:
          sealed class Class_Name
          { // etc }
 In case of method
 syntax:
 class MyClass: MyclassBase
    {
    public sealed override void FinalMethod()
      { // etc }
    }
 class DerivedClass: MyClass
 {
 public override void FinalMethod() // wrong..will give compilation error
 { // etc } }
Constructors of Derived Classes

   Adding a constructor in a Hierarchy

   Adding a constructor with parameters to a
    Hierarchy
MODIFIERS
                  Modifiers can indicate the visibility of a methods.
MODIFIER           APPLIES TO                  DESCRIPTION

public             Any type or members         The item is visible to any
                                               other code.
protected          Any member of a type, also The item is visible only to
                   any nested type            any derived type.
internal           Any member of a type, also The item is visible only with
                   any nested type            in its containing assembley.
private            Any types or memebers       The item is visible only
                                               inside the type to which it
                                               belongs
protected internal Any member of a type, also The item is visible to any
                   any nested type            code within its containing
                                              assembly and also to any
                                              code inside a derived type
MODIFIER APPLIES TO                DESCRIPTION
new        Function members        The member hides an inherited
                                   member with the same signature
static     All members             The member does not operate on a
                                   specific instance of the class
virtual    Function members only The member can be overridden by a
                                 derived class
abstract   Function members only A virtual member that defines the
                                 signature of the member, but doesn’t
                                 provide an implementation.
override   Function members only The member overrides an inherited
                                 virtual or abstract member
sealed     Classes, methods, and   class cannot be inherited, member
           properties              overrides an inherited virtual member,
                                   but cannot be overridden by any
                                   members in any derived classes
extern     static [DllImport]      The member is implemented
           methods only            externally, in a different language.
INTERFACES
syntax:

    public interface Interface_Name
    {
      void method();
    }

   You can never instantiate an interface, it contains only the
    signatures of its members.

   An interface has neither constructors nor fields and also not
    allowed to contain operator overloads.

   An interface members are always implicitly public, and cannot
    be declared as virtual or static.
Inheritance C#

More Related Content

What's hot

This keyword in java
This keyword in javaThis keyword in java
This keyword in javaHitesh Kumar
 
Classes and Objects in C#
Classes and Objects in C#Classes and Objects in C#
Classes and Objects in C#Adeel Rasheed
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methodsShubham Dwivedi
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and InterfaceHaris Bin Zahid
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packagesVINOTH R
 
Abstract class in c++
Abstract class in c++Abstract class in c++
Abstract class in c++Sujan Mia
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...Simplilearn
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
 
class and objects
class and objectsclass and objects
class and objectsPayel Guria
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 

What's hot (20)

This keyword in java
This keyword in javaThis keyword in java
This keyword in java
 
Classes and Objects in C#
Classes and Objects in C#Classes and Objects in C#
Classes and Objects in C#
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
Inheritance
InheritanceInheritance
Inheritance
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
 
Abstract class in c++
Abstract class in c++Abstract class in c++
Abstract class in c++
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
 
Inheritance in OOPS
Inheritance in OOPSInheritance in OOPS
Inheritance in OOPS
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
class and objects
class and objectsclass and objects
class and objects
 
Interface
InterfaceInterface
Interface
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Method overriding
Method overridingMethod overriding
Method overriding
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 

Similar to Inheritance C#

116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 eehomeworkping9
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview QestionsArun Vasanth
 
Master of Computer Application (MCA) – Semester 4 MC0078
Master of Computer Application (MCA) – Semester 4  MC0078Master of Computer Application (MCA) – Semester 4  MC0078
Master of Computer Application (MCA) – Semester 4 MC0078Aravind NC
 
Chap3 inheritance
Chap3 inheritanceChap3 inheritance
Chap3 inheritanceraksharao
 
Class properties
Class propertiesClass properties
Class propertiesSiva Priya
 
Oops abap fundamental
Oops abap fundamentalOops abap fundamental
Oops abap fundamentalbiswajit2015
 
Complete java&j2ee
Complete java&j2eeComplete java&j2ee
Complete java&j2eeShiva Cse
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobGaruda Trainings
 
Java Basics Presentation
Java Basics PresentationJava Basics Presentation
Java Basics PresentationOmid Sohrabi
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismJawad Khan
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interviewKuntal Bhowmick
 

Similar to Inheritance C# (20)

Lecture 10
Lecture 10Lecture 10
Lecture 10
 
116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 ee
 
Core java questions
Core java questionsCore java questions
Core java questions
 
Java Core
Java CoreJava Core
Java Core
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
java tutorial 4
 java tutorial 4 java tutorial 4
java tutorial 4
 
Interface
InterfaceInterface
Interface
 
C# interview
C# interviewC# interview
C# interview
 
Master of Computer Application (MCA) – Semester 4 MC0078
Master of Computer Application (MCA) – Semester 4  MC0078Master of Computer Application (MCA) – Semester 4  MC0078
Master of Computer Application (MCA) – Semester 4 MC0078
 
Chap3 inheritance
Chap3 inheritanceChap3 inheritance
Chap3 inheritance
 
Class properties
Class propertiesClass properties
Class properties
 
LectureNotes-02-DSA
LectureNotes-02-DSALectureNotes-02-DSA
LectureNotes-02-DSA
 
Oops abap fundamental
Oops abap fundamentalOops abap fundamental
Oops abap fundamental
 
Complete java&j2ee
Complete java&j2eeComplete java&j2ee
Complete java&j2ee
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
 
1
11
1
 
Java Basics Presentation
Java Basics PresentationJava Basics Presentation
Java Basics Presentation
 
Java
JavaJava
Java
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphism
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interview
 

More from Raghuveer Guthikonda (9)

C# String
C# StringC# String
C# String
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 
Operators & Casts
Operators & CastsOperators & Casts
Operators & Casts
 
Arrays C#
Arrays C#Arrays C#
Arrays C#
 
Generics C#
Generics C#Generics C#
Generics C#
 
Objects and Types C#
Objects and Types C#Objects and Types C#
Objects and Types C#
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Regex in C#
Regex in C#Regex in C#
Regex in C#
 

Recently uploaded

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Inheritance C#

  • 1. Inheritance Types of inheritance Implementing inheritance Interface
  • 2. TYPES OF INHERITANCE  Implementation inheritance means that a type derives from a base type, taking all the base type’s member fields and functions.  Interface inheritance means that a type inherits only the signatures of the functions and does not inherit any implementations.
  • 3. IMPLEMENTATION INHERITANCE  A class derive from another class syntax: Class MyDerivedClass: MyBaseClass { //function and data memebers here}  A class derive from interface,the list of base class and interfaces is separated by commas syntax: Public class MyDerivedClass: MyBaseClass, Interface1,Interface2 {//function and data memebers here}
  • 4. VIRTUAL METHODS  By declaring a base class function as virtual, you allow the function to be overridden in any derived classes. Class MyBaseClass { public virtual string VirtualMethod( ) { return “this method is virtural and defined in MyBaseClass” ;} }  It is also permitted to declare a property as virtual. Public virtual string ForeName { get { return foreName;} set { foreName=value;} }
  • 5. HIDING METHODS  If a method with the same signature is declared in both base and derived classes, but the methods are not declared as virtual and override, respectively, then the derived class version is said to hide the base class version.  Abstract classes and Functions:  An abstract class cannot be instantiated,were as an abstract function does not have an implementation,and must be overriden in any non-abstract derived class  Abstract function is automatically virtual.
  • 6. SEALED CLASSES AND METHODS  C# allows classes and methods to be declared as sealed.  In case of class this means that you can’t inherit from that class syntax: sealed class Class_Name { // etc }  In case of method syntax: class MyClass: MyclassBase { public sealed override void FinalMethod() { // etc } } class DerivedClass: MyClass { public override void FinalMethod() // wrong..will give compilation error { // etc } }
  • 7. Constructors of Derived Classes  Adding a constructor in a Hierarchy  Adding a constructor with parameters to a Hierarchy
  • 8. MODIFIERS  Modifiers can indicate the visibility of a methods. MODIFIER APPLIES TO DESCRIPTION public Any type or members The item is visible to any other code. protected Any member of a type, also The item is visible only to any nested type any derived type. internal Any member of a type, also The item is visible only with any nested type in its containing assembley. private Any types or memebers The item is visible only inside the type to which it belongs protected internal Any member of a type, also The item is visible to any any nested type code within its containing assembly and also to any code inside a derived type
  • 9. MODIFIER APPLIES TO DESCRIPTION new Function members The member hides an inherited member with the same signature static All members The member does not operate on a specific instance of the class virtual Function members only The member can be overridden by a derived class abstract Function members only A virtual member that defines the signature of the member, but doesn’t provide an implementation. override Function members only The member overrides an inherited virtual or abstract member sealed Classes, methods, and class cannot be inherited, member properties overrides an inherited virtual member, but cannot be overridden by any members in any derived classes extern static [DllImport] The member is implemented methods only externally, in a different language.
  • 10. INTERFACES syntax: public interface Interface_Name { void method(); }  You can never instantiate an interface, it contains only the signatures of its members.  An interface has neither constructors nor fields and also not allowed to contain operator overloads.  An interface members are always implicitly public, and cannot be declared as virtual or static.