storing a double value in an object - CSharp Custom Type

CSharp examples for Custom Type:class

Description

storing a double value in an object

Demo Code

using System;//from   w ww .  ja v a  2s . co m
class Program
{
   static void Main(string[] args)
   {
      object height = 1.88; // storing a double value in an object
      object name = "abc"; // storing a string value in an object
      int length2 = ((string)name).Length; // cast to access members
      Console.WriteLine(length2);
      Console.WriteLine(height);
      Console.WriteLine(name);
   }
}

Result


Related Tutorials