Saturday, May 25, 2024 05:19

Table of contents >> Introduction > Object variable type

Object variable type

Object variable type is a special type, the parent of all other types in the .NET Framework. It can accept values from any other type in C#, and we declare it using the word object

In the following example you can see how we can assign any type to an object variable type:

And the output would be:

object variable type

As you can notice, the object variable can be very versatile, and we can use it as a universal data container.

The concepts explained in this lesson are also shown visually as part of the following video:

Tags: , ,

Leave a Reply

Follow the white rabbit