- Learn C# in 7 days
- Gaurav Aroraa
- 309字
- 2021-07-08 09:51:24
An overview of C# reserved keywords, types, and operators
Reserved keywords are nothing but predefined words that have special meaning for the compilers. You cannot use these reserved keywords as normal text or identifiers unless you explicitly tell the compiler that this word is not meant to reserve for the compiler.
In C#, you can use the reserved keyword as a normal word by prefixing the @ symbol.
C# keywords are divided into the following categories:
- Types: In C#, the typing system is divided into value type, reference type, and pointer type.
- Modifiers: As is self-explanatory from its name, modifiers are used to modify the declaration of types and members of a specific type.
- Statement keywords: These are programming instructions that execute in a sequence.
- Method parameters: These can be declared as a value type or a ref type and values can be passed using out or ref keywords.
- Namespace keywords: These are the keywords that belong to namespaces only.
- Operator keywords: These operators are generally used to perform miscellaneous operations, such as type checking, getting the size of the object, and so on.
- Conversion keywords: These are explicit, implicit, and operator keywords, which will be discussed in the upcoming sections.
- Access keywords: These are common keywords that help access things from a class that belongs to its parent class or belongs to its own. These keywords are this and base.
- Literal keywords: Keywords have some values for assignment, which are null, true, false , and default.
- Contextual keywords: These are used as a specific meaning in the code. These are special keywords that are not reserved keywords in C#.
- Query keywords: These are contextual keywords that can be used in a query expression, for instance, the from keyword can be used for LINQ.
In the upcoming sections, we will discuss C# keywords in more detail using code examples.
推薦閱讀
- AngularJS Web Application Development Blueprints
- Python程序設(shè)計(第3版)
- Developing Middleware in Java EE 8
- 算法大爆炸:面試通關(guān)步步為營
- Cassandra Design Patterns(Second Edition)
- Learning Apache Mahout Classification
- R大數(shù)據(jù)分析實用指南
- D3.js By Example
- Python趣味編程與精彩實例
- Emotional Intelligence for IT Professionals
- Raspberry Pi開發(fā)實戰(zhàn)
- 樹莓派開發(fā)從零開始學(xué):超好玩的智能小硬件制作書
- Access 2016數(shù)據(jù)庫應(yīng)用與開發(fā):實戰(zhàn)從入門到精通(視頻教學(xué)版)
- Appcelerator Titanium Smartphone App Development Cookbook
- 軟件自動化測試實戰(zhàn)解析:基于Python3編程語言