Answered Questions

  • Why can't we use Multiple inheritance and garbage collector parallelly in .net

    Star Read Best Answer

    Editorial / Best Answer


    • Member Since Sep-2008 | Sep 11th, 2008

    Well C# doesn't support multiple inheritance through classes.

    If you want to have multiple inheritance in your program, you need to make use of interfaces. A class cannot inherit from more than one class but a class can inherit from more than one interfaces. So C# supports multiple inheritance through interfaces. 
    And multiple inheritance and garbage collection can work independent of each other because, in .NET framework, garbage collection is taken care of by CLR. We can also manually invoke garbage collector using gc.collect(). 

    Mob: +91 9849255958

    • Jan 4th, 2007

    Actually, GC is a low-level thread.  When it gets activated, all other threads in the applications are put on hold.