15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2Core <strong>C#</strong><br />

WhaT ’ s in This ChaPTer<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

➤<br />

Declaring variables<br />

Initialization <strong>and</strong> scope of variables<br />

Predefi ned <strong>C#</strong> data types<br />

Dictating the fl ow of execution within a <strong>C#</strong> program using conditional statements,<br />

loops, <strong>and</strong> jump statements<br />

Enumerations<br />

Namespaces<br />

The Main() method<br />

Basic comm<strong>and</strong> - line <strong>C#</strong> compiler options<br />

U s i n g System.Console to perform console I/O<br />

Using internal comments <strong>and</strong> documentation features<br />

Preprocessor directives<br />

Guidelines <strong>and</strong> conventions for good programming in <strong>C#</strong><br />

Now that you underst<strong>and</strong> more about what <strong>C#</strong> can do, you will want to learn how to use it. This<br />

chapter gives you a good start in that direction by providing you with a basic knowledge of the<br />

fundamentals of <strong>C#</strong> programming, which is built on in subsequent chapters. By the end of this<br />

chapter, you will know enough <strong>C#</strong> to write simple programs (though without using inheritance or<br />

other object - oriented features, which are covered in later chapters).<br />

your firsT <strong>C#</strong> Program<br />

Let ’ s start by compiling <strong>and</strong> running the simplest possible <strong>C#</strong> program — a simple console app<br />

consisting of a class that writes a message to the screen.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!