What are the differences between extern, abstract, and partial for methods in an abstract class?

extern is unlikely to be something you want to use. It means that the method is implemented, but implemented externally - and typically used in interop scenarios where you're defining a method implelemented in external code.

abstract, on the other hand, means you're defining the API for the method, but not providing an implementation. The subclass will have to provide the implementation for any methods or properties marked abstract, or be abstract itself. If you want to make a base class and have a method or property that must be implemented by subclasses, you'll want to use abstract.

partial classes and methods are merely a compilation tool. They allow you to use multiple files to define your type. This is mostly used with automatically generated code (ie: a designer will put the designer generated code into a separate file defining a partial class, so you can 'fill in' the missing pieces without looking at the implementation details). This is unlikely something you'll use directly for defining a class.


An extern method is typically being implemented via a dll-import (P/Invoke) - so it does have an implementation - you just can't see it.

A partial method is useful mainly with code-generation as a way to inject functionality into the generated code. They are optional, private only, and only exist if you provide the other half. As such there are also some limitations around return/out values to assure definite assignment. Calls to partial methods will be omitted entirely by the compiler if there is no implementation.

An abstract method is where the implementation has to be provided by a derived type. The runtime ensures you can't have an instance if there are still unimplemented abstract methods, so you are assured that they will exist at runtime.


Extern will allow you use methods via dll-import and by this you are giving a special meaning to that method that it's coming from external sources

Partial :

  1. A partial method must be declared within a partial class or partial struct
  2. You can't have access modifier on Partial Method
  3. A partial method cannot have access modifiers or the virtual, abstract, override, new, sealed, or extern modifiers
  4. Partial method can't have its implementation before separate declaration.
  5. Partial method can only be defined and can't be declared in the same partial class.

*Most important Difference between Partial and Abstract method is Partial's Implementation is optional but Abstract method's implementation is compulsory *

Abstract methods strictly require the implementation in non abstract derived class

The basic use of abstract methods is, they are required to be implemented in order to use the class because those methods help to leverage that class efficiently