Why is System.Object not abstract in .NET?

Sometimes you just need an Object, and nothing else, such as when using a random reference type for things like implementing multithreading locks. Not making object abstract allows use in those situations. The Monitor.Enter and Monitor.Exit classes (which is the basis behind the "lock" keyword in C#) can acquire a lock on any given object, regardless of implementation.


Surely for a class to be abstract means that it has some functionality which requires implementation...

System.Object does everything it needs to thus it is not Abstract.

I think you misunderstand why things are made abstract, it's becuase they contain some useful functionality and don't dictate how you implement some parts of thier functionality.

Essentially they are half made classes, like a model kit, which you get to customise to work the way you want to, but you don't have to roll the whole thing from scratch.

They do not exist to stop you from creating instances of them.


The easiest way to answer that question is to ask another one: is there any reason for the Object class to be abstract? Since there is no reason for it to be abstract, it's not.

Tags:

.Net

Oop