what is the process that is under take in clr when we inherit a class? RRS feed


  • Hi Narayan,

    Welcome to the MSDN Forum.


    The .NET Framework provides a run-time environment called the common language runtime, which runs the code and provides services that make the development process easier.

    Inheritance : 

    Inheritance, together with encapsulation and polymorphism, is one of the three primary characteristics (or pillars) of object-oriented programming. Inheritance enables you to create new classes that reuse, extend, and modify the behavior that is defined in other classes. The class whose members are inherited is called thebase class, and the class that inherits those members is called the derived class. A derived class can have only one direct base class. However, inheritance is transitive. If ClassC is derived from ClassB, and ClassB is derived from ClassA, ClassC inherits the members declared in ClassB and ClassA.

    I quote these to explain Inheritance is an OOP characteristic, CLR doesn't care the code has or not inheritance characteristic. The CLR focuses on "makes it easy to design components and applications whose objects interact across languages.

    Actually, CLR doesn't know ":": 

    When you compile the C# code, the compiler " translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code." So the C# compiler knows the signal ":".

    I hope this will be helpful.

    Best regards,

    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 25, 2012 9:15 AM