Pages

Saturday 4 June 2011

Type casting in c#.Net.

0 comments
 
Hi friends,in this post i would like to explain type casting concept in C#.Net.

* Type casting is the concept of converting one datatype to another datatype.

* C#.Net supports 2 types of type casting:
1)Implicit type casting.
2)Explicit type casting.

* Implicit type casting is under control or CLR.
* Explicit type casting is under control of programmer.

* Converting from Lower data types into Higher data types is called as Implicit type casting.
For Example:
Byte---->Long(Implicit)

* Converting from Higher data types into Lower data types is called as Explicit type casting.
For Example:
long---->int(Explicit)

* C#.Net supports 4 types of Explicit Type Casting:
1)C++ style of TypeCasting
2)Converting
3)Parsing
4)Boxing & UnBoxing.


Thank You.
Shout it

Leave a Reply