ASP.NET 2.0 All-In-One Desk Reference For Dummies®
by Doug Lowe, Jeff Cogswell, Ken Cox - Microsoft MVP
Chapter 1. C# Programming Basics
In This Chapter
✓ | Examining keywords |
✓ | Inspecting statements |
✓ | Perusing blocks |
✓ | Reviewing comments |
✓ | Surveying classes |
✓ | Investigating variables |
✓ | Considering data types |
✓ | Observing operators |
✓ | Experiencing expressions |
In this chapter, you find the basics of writing C# code. If you’ve been browsing around in the book, you’ve already seen plenty of C# code examples, so I won’t start with a basic “Hello World!” program (the way most introductory C# programming books do). Instead, I’ll dive right into the building blocks of C# programs, such as keywords, statements, blocks, and so on.
So jump in and hang on!
Dealing with Keywords
A keyword is a word that has special meaning defined by the C# programming language. In all, C# has 77 keywords. They’re listed in alphabetical order in Table 1-1.
Table 1-1. The C# Keywords
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
| |
|
|
|

Like everything else in C#, keywords are case-sensitive. Thus, if you type If instead of if or For instead of for, the compiler complains about ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access