C# Convert ToChar(Boolean)

Description

Convert ToChar(Boolean) calling this method always throws InvalidCastException.

Syntax

Convert.ToChar(Boolean) has the following syntax.


public static char ToChar(
  bool value
)

Parameters

Convert.ToChar(Boolean) has the following parameters.

  • value - The Boolean value to convert.

Returns

Convert.ToChar(Boolean) method returns This conversion is not supported. No value is returned.

Example


using System;//w ww  .j a v  a 2 s.c  o m
public class MainClass{
  public static void Main(String[] argv){  
    System.Console.WriteLine(Convert.ToChar(true));
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version