Why object type can contain any type of data.....??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why object type can contain any type of data.....???

Why object type can contain any type of data.....???

18th Dec 2016, 2:20 PM
Gopikrishna A
Gopikrishna A - avatar
1 Answer
+ 1
The object class holds a central place in the .NET framework. It is the base class for each and every class in both the code you write and the .NET framework itself. From the MSDN entry for System.Object (https://msdn.microsoft.com/en-us/library/system.object(v=vs.110).aspx): " Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy. Languages typically do not require a class to declare inheritance from Object because the inheritance is implicit. Because all classes in the .NET Framework are derived from Object, every method defined in the Object class is available in all objects in the system. Derived classes can and do override some of these methods. "
18th Dec 2016, 3:35 PM
Shai Cohen