Compiler Error CS0239
'member' : cannot override inherited member 'inherited member' because it is sealed
A member cannot override a sealed inherited member. For more information, see Inheritance.
The following sample generates CS0239:
C#
// CS0239.cs
abstract class MyClass
{
public abstract void f();
}
class MyClass2 : MyClass
{
public static void Main()
{
}
public override sealed void f()
{
}
}
class MyClass3 : MyClass2
{
public override void f() // CS0239
// Try the following definition instead:
// public new void f()
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: