You can use:
public class @class { }
But why do you need this?
Keywords C #
Keywords are predefined, reserved identifiers that have special meanings for the compiler. They cannot be used as identifiers in yours unless they include @ as a prefix. For example, @if is a valid identifier, but if it is not, since if is a keyword.
What I learned from this answer was that new keywords will not be added globally, but only as contextual keywords, so as not to disrupt programs written in earlier versions. You will find the list in the link above.
So interesting, this is really (better: compilation) code:
public class var { public void foo() { var var = new var(); } }
Here's another one:
public class dynamic { public void foo() { dynamic dynamic = new dynamic(); } }
But never do that. It will break your other code where you used var or dynamic before.
source share