Skip to content

object

object is the ultimate base class of all types in .NET.

object obj1 = 42;
object obj2 = "Hello";
object obj3 = 3.14;
Console.WriteLine($"{obj1}, {obj2}, {obj3}");
Terminal window
dotnet run
Terminal window
42, Hello, 3.14