October 2008
Beginner to intermediate
680 pages
16h 48m
English
C# (like C, C++, and Java) is a block structured language. As mentioned earlier in the chapter, a "block" of code is a series of zero or more lines of code enclosed within braces, like so: {...}.
A method declaration, like the Main method of our SimpleProgram, defines a block.
A class declaration, like the SimpleProgram class as a whole, also defines a block.
As you have seen, many control flow statements also involve defining blocks of code.
Blocks can be nested inside one another to any arbitrary depth:
public class SimpleProgram { // We're inside of the 'class' block (one level deep). static void Main() { // We're inside of the 'Main method' block (two levels deep). int x = 3; int y = 4; int z = 5; if (x ...Read now
Unlock full access