why object accept as any type of data varible please tell me sir

Posted by Harieswer under C# on 5/30/2015 | Points: 10 | Views : 308 | Status : [Member] | Replies : 2
why object accept as any type of data varible please tell me sir




Responses

Posted by: Sheonarayan on: 5/31/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
It is to do with how the .NET Framework language like C# has been designed. All data types like string, int, DateTime inherits object when they have been defined. So you can set any type of data into object variable.

Hope this helps.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Harieswer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 9/28/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
MSDN says, System.Object is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy.

--
Thanks & Regards,
RNA Team

Harieswer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response