Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.
As we all know that all the primitive types like Int32, double etc comes from the System.ValueType class. Ever wonder that what will happen if you make a variable of System.ValueType. Try something like this:
 
System.ValueType a; 
a = -0.33442; 
Response.Write(a.GetType());  // This will print double 
a = 2;
Response.Write(a.GetType());  // This will print Int32
Basically it will take any form of primitive type that you will assign to it. pretty cool right :) Posted on Tuesday, June 21, 2005 11:28 AM | Back to top


Comments on this post: Making a variable of System.ValueType

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net