PART I
C h a p t e r 2 :
A n O v e r v i e w o f C #
25
PART IPART I
to
WriteLine( )
, notice that
y
is used by itself. Both
Write( )
and
WriteLine( )
can be used to
output values of any of C#’s built-in types.
One more point about declaring variables before we move on: It is possible to declare
two or more variables using the same declaration statement. Just separate their names by
commas. For example,
x
and
y
could have been declared like this:
int x, y; // both declared using one statement
N
OTE
N
OTE
C# 3.0 includes a new feature called an
implicitly typed variable
. Implicitly typed
variables are variables whose type is automatically determined by the compiler. Implicitly typed
variables are discussed in Chapter 3.
Do'stlaringiz bilan baham: |