Skip to main content

What is the base class for all types in C#?

Junior C#
Quick Answer Everything in C# ultimately inherits from System.Object (aliased as object). This gives every type รขโ‚ฌโ€ even int รขโ‚ฌโ€ methods like ToString(), Equals(), GetHashCode(), and GetType(). That is why you can assign anything to an object variable, though boxing happens for value types.

Answer

The root class for all .NET types is System.Object.

It provides behaviors like equality, hashing, and type information.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice