Register now or log in to join your professional community.
The very important point in using interface is: there is no inheritance. As you know, programming languages like Java, C#, VB don’t support multiple-inheritance; meaning a class can inherit from one class only.
Let’s say you write a code for counting a collection and the method signature is as follow:
public static void Count(ICollection collection);
Your method expects two functions from the collection object: GoToFirst, GoNext.
If I have a class called MyCollection which inherit from class called ArrayList and would like to use your count method, all I have to do is implement the two methods.
The concept behind Interface is very similar to abstract classes, but it eliminates the need to inherit from a class.
This way a class can play multiple roles while inheriting from one class only.
Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.