Console.WriteLine Method (Boolean)

 

Writes the text representation of the specified Boolean value, followed by the current line terminator, to the standard output stream.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

<HostProtectionAttribute(SecurityAction.LinkDemand, UI := True)>
Public Shared Sub WriteLine (
	value As Boolean
)

Parameters

value
Type: System.Boolean

The value to write.

Exception Condition
IOException

An I/O error occurred.

The text representation of value is produced by calling the Boolean.ToString method.

For more information about the line terminator, see the Remarks section of the WriteLine method that takes no parameters.

The following example generates ten random integers and uses the Console.WriteLine(Boolean) method to indicate whether they are even.

Module Example
   Public Sub Main()
      ' Assign 10 random integers to an array.
      Dim rnd As New Random()
      Dim numbers(9) As Integer
      For ctr As Integer = 0 To numbers.GetUpperBound(0)
         numbers(ctr) = rnd.Next
      Next

      ' Determine whether the numbers are even or odd.
      For Each number In numbers
         Dim even As Boolean = (number mod 2 = 0)
         Console.WriteLine("Is {0} even:", number)
         Console.WriteLine(even)
         Console.WriteLine()      
      Next
   End Sub
End Module

UIPermission

for modifying safe top-level windows and subwindows. Associated enumeration: UIPermissionWindow.SafeTopLevelWindows

.NET Framework
Available since 1.1
Return to top
Show: