I know it is commonly used as a lock object, but is that really sufficient reason? What is the meaning of
object o = new object();
An non-abstract class is something that represents actual objects. "asdasdf" is a string. What actual instance can there be of "object" class? It doesn't make sense, OOP-wise. My question is if there is some practical reason for its existence (besides being used as a lock object).
The Object class is the base class for all the classes in the . Net Framework. It is present in the System namespace. In C#, the . NET Base Class Library(BCL) has a language-specific alias which is Object class with the fully qualified name as System.
An abstract object class is much like an abstract Java class in that just as you can't directly instantiate an abstract Java class but must instantiate a non-abstract subclass, you can't create an entry with an abstract object class unless the entry has at least one non-abstract object class that inherits from that ...
Abstract class: is a restricted class that cannot be used to create objects (to access it, it must be inherited from another class).
An abstract method must be implemented in all non-abstract classes using the override keyword. After overriding, the abstract method is in the non-Abstract class. We can derive this class in another class, and again we can override the same abstract method with it.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With