CSharp examples for Language Basics:Data Type Cast
Casting and Converting value to string
using System;/*from w w w.j a v a2s. c om*/ using static System.Console; using static System.Convert; class Program { static void Main(string[] args) { int number = 12; WriteLine(number.ToString()); bool boolean = true; WriteLine(boolean.ToString()); DateTime now = DateTime.Now; WriteLine(now.ToString()); object me = new object(); WriteLine(me.ToString()); } }