WriteLine( )
. In this case,
WriteLine( )
displays the string that is passed to it. Information that is passed to a method is called an
argument.
In addition to strings,
WriteLine( )
can be used to display other types of information.
The line begins with
Console
, which is the name of a predefined class that supports console
I/O. By connecting
Console
with
WriteLine( )
, you are telling the compiler that
WriteLine( )
is a member of the
Console
class. The fact that C# uses an object to define console output is
further evidence of its object-oriented nature.
Notice that the
WriteLine( )
statement ends with a semicolon, as does the
using System
statement earlier in the program. In general, statements in C# end with a semicolon. The
exception to this rule are
blocks,
which begin with a
Do'stlaringiz bilan baham: |