C# Console WriteLine(Object)
Description
Console WriteLine(Object)
writes the text representation
of the specified object, followed by the current line terminator, to the
standard output stream.
Syntax
Console.WriteLine(Object)
has the following syntax.
[HostProtectionAttribute(SecurityAction.LinkDemand, UI = true)]
public static void WriteLine(
Object value
)
Parameters
Console.WriteLine(Object)
has the following parameters.
value
- The value to write.
Returns
Console.WriteLine(Object)
method returns
Example
The following example uses the WriteLine(Object) method to display each value in an object array to the console.
using System;//from ww w . j ava 2 s . c o m
public class Example
{
public static void Main()
{
Object[] values = { true, 12.632, 17908, "stringValue",
'a', 16907.32m };
foreach (var value in values)
Console.WriteLine(value);
}
}