PART I
C h a p t e r 2 :
A n O v e r v i e w o f C #
21
PART IPART I
This is the second type of comment supported by C#. A single-line comment begins with
a
//
and ends at the end of the line. Although styles vary, it is not uncommon for programmers
to use multiline comments for longer remarks and single-line comments for brief, line-by-
line descriptions. (The third type of comment supported by C# aids in the creation of
documentation and is described in Appendix A.)
The next line of code is shown here:
static void Main() {
This line begins the
Main( )
method. As mentioned earlier, in C#, a subroutine is called a
method. As the comment preceding it suggests, this is the line at which the program will
begin executing. All C# applications begin execution by calling
Main( )
. The complete
meaning of each part of this line cannot be given now, since it involves a detailed
understanding of several other C# features. However, since many of the examples in
this book will use this line of code, we will take a brief look at it here.
The line begins with the keyword
Do'stlaringiz bilan baham: |