The requested page is not available for the requested platform. You are viewing the content for Default platform.

Sealed class cannot be abstract

CodeRush Classic shows the Sealed class cannot be abstract code issue if a sealed class is marked as abstract.

Fix

Remove the abstract or sealed modifier from the class declaration.

Purpose

Highlights the class declarations, which would cause the "An abstract class cannot be sealed or static" compilation error.

Example

public sealed abstract class MyClass

Fixes:

public sealed class MyClass
public abstract class MyClass