When to Use a Interface or Inheritance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Morning:
I have a simple question I was hoping someone can help me understand. In
Visual Basic.Net when is it best to use an Interface compared to using
Inheritance? For example, if I have a class called PERSON and create other
classes one being EMPLOYEE and another being STUDENT and PERSON holds members
and maybe 1 function that EMPLOYEE and STUDENT uses is it best to use
Inheritance? Better yet, can I use an Interface and Inheritance? Let me know
you opinions and comments are greatly appreciated.
 
Hi Terrance

I appriciate ans of the Patrice.In addition to that link, following link is
also useful to clear the concepts.

http://www.churchillobjects.com/c/11003.html

Points to be rember while making the decision of Interface or Abstract Class :

1. We must have to implement all the methods of Interface in the
implementing class.
2. We cannot inherit more the one baseclasses in the single subclass

More tips can be find on specified link.

Bhavesh
 
Hi Terrance

I appriciate ans of the Patrice.In addition to that link, following link is
also useful to clear the concepts.

http://www.churchillobjects.com/c/11003.html

Points to be rember while making the decision of Interface or Abstract Class :

1. We must have to implement all the methods of Interface in the
implementing class.
2. We cannot inherit more the one baseclasses in the single subclass

More tips can be find on specified link.

Bhavesh
 
Back
Top