Monday, November 24, 2008

Explicit Conversions Using the Convert Commands

There are many explicit conversions that you can specify in this way, as follows.

Command Result

Convert.ToBoolean ( val ) val converted to bool

Convert.ToByte( val) val converted to byte

Convert.ToChar( val) val converted to char

Convert.ToDecimal( val) val converted to decimal

Convert.ToDouble( val) val converted to double

Convert.ToInt16( val) val converted to short

Convert.ToInt32( val) val converted to int

Convert.ToInt64( val) val converted to long

Here you can see sample program that is use explicit conversion



here is the out put...

No comments: