Object Type

Object Type

Object Type



Object type is a special type, which is the parent of all other types in the .NET Framework. Declared with the keyword object, it can take values from any other type. It is a reference type, i.e. an index (address) of a memory area which stores the actual value.

Using Objects – Example


Consider an example in which we declare several variables of type object, initialize them and print their values on the console:


As you can see from the example, we can store the value of any other type in an object type variable. This makes the object type a universal data container.

Post a Comment

0 Comments