Compiler Error CS0441
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

Compiler Error CS0441 

Error Message

'class': a class cannot be both static and sealed

This error occurs when you declare a class that is both static and sealed. Static classes are inherently sealed, so the sealed modifier is not necessary. To resolve, use one modifier only.

The following example generates CS0441:

// CS0441.cs
sealed static class MyClass { }   // CS0441
© 2016 Microsoft