Results 1 to 5 of 5

Thread: abstract classes vs interfaces

  1. #1

    Thread Starter
    Hyperactive Member BramVandenbon's Avatar
    Join Date
    Jan 2002
    Location
    Belgium
    Posts
    502

    abstract classes vs interfaces

    Big problem ... I have a test tomorrow about Polymorphism, inheritance, interfaces and abstract classes in C#.


    My main question is... abstract classes and interfaces seem to do the same thing ? (Or am i missing something ?)

    Then when do you use a abstract class and when do you prefer an interface instead ?



    Thanks in advance
    ____________________________________________

    Please rate my messages. Thank you!
    ____________________________________________
    Bram Vandenbon
    http://www.bramvandenbon.com

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Off the top of my head ,
    classes can inherit one class but many interfaces .So, using interfaces would give you multiple inheritance .

    abstract classes :
    1- usually used as base classes
    2-can't be instantiated.

  3. #3

    Thread Starter
    Hyperactive Member BramVandenbon's Avatar
    Join Date
    Jan 2002
    Location
    Belgium
    Posts
    502
    thank you very much ! that's a great answer, my compliments
    ____________________________________________

    Please rate my messages. Thank you!
    ____________________________________________
    Bram Vandenbon
    http://www.bramvandenbon.com

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You should check MSDN for more info .It's helpful with examples.
    good luck in your test.

  5. #5

    Thread Starter
    Hyperactive Member BramVandenbon's Avatar
    Join Date
    Jan 2002
    Location
    Belgium
    Posts
    502
    thanks
    I've put up another post about another question. Who knows , you might be able to help there too ? would be great
    ____________________________________________

    Please rate my messages. Thank you!
    ____________________________________________
    Bram Vandenbon
    http://www.bramvandenbon.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width