23
Reply

Which class is not inherited from object class?

    None! All of the classes must inherit from System.Object class, that is why all of the classes have .ToString, GetHashCode and other Object inherited functions. What others here are saying, that Sealed class or abstract class is not inherited, is totally wrong. There is no class such as Sealed, sealed means that the class "cannot be inherited" by other classes. It doesn't mean that this class was never inherited by any class. System.Object class is a parent class to all of the classes. Abstract and Sealed are keywords, that let developers tell the compiler, that this class should not be inherited (in case of sealed) and that it should not be initialized and if inherited then its functions if abstract, must be given a body (in case of abstract). But getting outside of the .NET, the raw unsafe pointers are not inherited from System.Object class. So this might be the answer to which object doesn't inherit from System.Object.

    All classes is inherited from object class

    All objects inherit from System.Object. Sealed only means no one can inherit from you and Abstract means you cannot directly instantiate the class.

    Absract Class we can not create the object

    I have read many blogs and answers some are saying that sealed and abstract class can not be inherited from system.object class. But it is wrong. System.Object class is the parent class of all the classes. By the definition of class sealed and abstract class , definitions saying that you can inherite the class or you cann't make derived from these class . It is not saying it s not inherited from system.Object class. So we definitely say that all the class is inhetited from system.Object class.

    System.Object is a base class of all classes in .Net framework. So all classes in .Net Framework have inherited from System.Object class.

    All class Inherited from Object Class and Explanation by @Afzaal is Correct

    sealed class

    sealed class

    sealed class

    sealed class

    sealed

    Abstract Class

    Abstract Class

    Sealed Class

    both reference type as well as value type inherit from System.Object. Did i say value type? Yes indeed value type also inherit from System.Object. This you can try yourself. Try creating a struct and we can see that the variable of that struct will be having all the functions like ToString(), GetType(), GetHashCode() as weel as Equals().

    All Classes are derived from Object class.

    Sealed class is not inherited

    Sealed Class

    Sealed class is not inherited

    Sealed Class not inherited

    Sealed Class

    abstract class