-2

How come System.Object is base class for int and string ?

user2082630
  • 259
  • 1
  • 3
  • 11

1 Answers1

0

as MSDN says:

Value types derive from System.ValueType, which derives from System.Object. Types that derive from System.ValueType have special behavior in the CLR. Value type variables directly contain their values, which means that the memory is allocated inline in whatever context the variable is declared. There is no separate heap allocation or garbage collection overhead for value-type variables.

Sergio
  • 6,900
  • 5
  • 31
  • 55