Appendix A. Keywords in C#

Keywords are reserved and cannot be used as identifiers. If you really want to choose a C# keyword as an identifier name, prefix it with a @. [1] For example, @new is a legal identifier but new is not.

[1] Highly discouraged by myself - there are lots of other words you can choose for your identifiers.

Table A.1 shows the list of C# keywords, and the chapters in which they are described in this book. Of all the C# keywords, only extern and stackalloc are beyond the scope of this book.

Table A.1. C# keywords
KeywordCommentsChapter
abstractModifier – used to declare a class or class member as abstract6
asOperator – a convenient combination of the typeof and is operators10
baseUsed to invoke a constructor in the super(base)class ...

Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.